DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3

Hybrid View

  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



Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links