wood burning stoves 2.0*
The moose likes JDBC and the fly likes Implementation of methods of Result Set Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Implementation of methods of Result Set" Watch "Implementation of methods of Result Set" New topic
Author

Implementation of methods of Result Set

Gautam Kundrai
Greenhorn

Joined: Apr 18, 2005
Posts: 3
Hi Friends
Could u tell me as all the methods of the ResultSet interface is abstract but we use them like next() getString(String),getMetaData() etc.
and they works HOW??? Where they are implemented ie which is the subclass
of the ResultSet plus also for Statement,PreparedStatement and Connection interfaces ....

Thanks
GAUTAM
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

How do any calls to an interface work? At runtime the method is called on a class which implements the interface. And that class will be part of the driver supplied by the database vendor.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Senthil B Kumar
Ranch Hand

Joined: Feb 09, 2004
Posts: 140
There is where the Database Drivers comes into place.

Now all database should support common operations of executing a query, trversion through the resultset, reading each column in a result, getting a connection,closing a connection ...etc.

So these standard operations are made as interface methods by Java.

Now the vendors who provide database drivers, implement this interface and hence they have to write their own implementation for each methods.

Say Oracle database driver will have its own logic/code of executing a query.

an SQL Server database driver will have its own logic/code for the same purpose.
Since both implement the Statement interface, we the developers need not worry what method to call if its a oracle driver or sql server driver.

we just call the method in the interface, and based upon the driver that is loaded, those methods are called and executed.

In that way, Java allows any database vendor to write their drivers but all drivers will be in a standard way ,without confusing the developer.


Work like you don't need the money. Love like you've never been hated. Dance like nobody's watching. Sing like nobody's listening. Live like it's Heaven on Earth.
Currently I Reside Here WEBlog
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Gautam,

The topic of this Forum is "Servlets".

Your question would probably get better responses in the Java In General (Beginner) forum.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Actually, I think the JDBC forum might be better.

I am moving this thread to the JDBC forum.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Implementation of methods of Result Set
 
Similar Threads
For Each ArrayList of Object in JSTL
Cursormoving without jdbc2.0
Is ResultSet is serializable ??
Get Updated Record
Methods in Interface