Resultset implementation


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Resultset implementation

  1. #1
    KNR Guest

    Resultset implementation


    While learning JDBC, I found the Resultset is an
    interface. Yet we can use its function like rs.next().

    How is this possible?

    I am aware when you execute a statement it returns a resultset
    object. But how is a Resultset object created, when there
    is no Resultset class?

    thanks,

    KNR

  2. #2
    Paul Clapham Guest

    Re: Resultset implementation

    What you are getting is an object of a class (unknown to you) that
    implements the ResultSet interface. You can find out what class it actually
    is by examining rs.getClass().

    This use of interfaces shouldn't be surprising, because it's the main reason
    that interfaces exist in Java.

    KNR <kanicheril@yahoo.com> wrote in message news:39510117$1@news.devx.com...
    >
    > While learning JDBC, I found the Resultset is an
    > interface. Yet we can use its function like rs.next().
    >
    > How is this possible?
    >
    > I am aware when you execute a statement it returns a resultset
    > object. But how is a Resultset object created, when there
    > is no Resultset class?
    >
    > thanks,
    >
    > KNR




  3. #3
    Ruchi Dhar Guest

    Re: Resultset implementation


    This is the magic of Multiple inheritence!!!!

    "KNR" <kanicheril@yahoo.com> wrote:
    >
    >While learning JDBC, I found the Resultset is an
    >interface. Yet we can use its function like rs.next().
    >
    >How is this possible?
    >
    >I am aware when you execute a statement it returns a resultset
    >object. But how is a Resultset object created, when there
    >is no Resultset class?
    >
    >thanks,
    >
    >KNR



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center