Doubts on Connection,Statement and ResulSet Interfaces

Ok I know that to connect to a database we have to use the Connection interface to setup the connection,

use Statement Interface to create SQL statements and

a ResultSet Interface to hold the results from the database.

My question is, where is the method definition for the following

Statement stmt=con.createStatement();

ResultSet rs=stmt.executeQuery("SELECT * from BLAH");

I know that their method declarations are there in the source files Connection.java,Statement.java and ResultSet.java.

By there has to be a class somewhere implementing these interfaces and defining the methods,rite?

If so, where is the method definitions?

[687 byte] By [ArcherKinga] at [2007-11-27 5:41:24]
# 1
That's what your JDBC driver vendor provides. When you register a JDBC driver, it notifies the DriverManager of the classes it provides which implement the JDBC interfaces
georgemca at 2007-7-12 15:18:51 > top of Java-index,Java Essentials,New To Java...
# 2
Indeed, in the java.sql package you will find only the interfaces of the JDBC API.The implementation is done by specific JDBC drivers which differ for each database and are usually provided by the database vendor in form of one or several jar files.
tobias.winterhaltera at 2007-7-12 15:18:51 > top of Java-index,Java Essentials,New To Java...
# 3

When u use Connection, Statement and ResultSet in your java code. Then u first import these packages--

import java.sql.Connection;

import java.sql.Statement;

import java.sql.ResultSet;

in your class.

Actually these are the .jar file and define and implement in that package before making .jar file. These are found in JDBC Driver like classes12.zip and ojdbc14.zip.

S_Singha at 2007-7-12 15:18:51 > top of Java-index,Java Essentials,New To Java...
# 4

I had been checking the source files, api docs and almost every where for the implementation.

I'm the kind that cant accept something as it is and have to open up and see where all the wires inside go ;)

Thanks for reply so quickly, I finally can stop looking.

I'll give ya both(georgemc & tobias.winterhalter) a duke star each ;)

Message was edited by:

ArcherKing

ArcherKinga at 2007-7-12 15:18:51 > top of Java-index,Java Essentials,New To Java...