• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Where is Implementation for this method

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We all know that ResultSet is an Interface.And for example

ResultSet rs = st.executeQuery(.....);

Now,
We give rs.next();

Where is the implementation for next() method.
We create reference for ResultSet and call the next() method.

Regards,
Vinod
 
Ranch Hand
Posts: 1140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The implementation is provided by the JDBC driver.
 
vinothk khannan
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Need Some More Explanation

Or hyper links to explanatory docs
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's all the explanation you should need. Read up on JDBC in your tutorial.
 
Mani Ram
Ranch Hand
Posts: 1140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by vinothk khannan:
Need Some More Explanation

Or hyper links to explanatory docs



Let me try. If you are using an Oracle driver to connect to Oracle database, the implementation for ResultSet interface is provided by the Oracle driver.

For example, if you look into the ojdbc.jar file, you can find a class called OracleResultSet(*) which implements java.sql.ResultSet.

So, when you say

what you get is is an object of type OracleResultSet, which has the implementation for all the methods defined in the java.sql.ResultSet interface.

If you are using someother database, say XYZ, the respective driver also will have a concrete implementation of all necessary interfaces.

Hope that helps.

(*) I'm not sure about the name of the class. I'm just guessing.
reply
    Bookmark Topic Watch Topic
  • New Topic