CuriousMind
CuriousMind

Reputation: 8923

JDBC API specification and implementation

I was going through JDBC API's (mainly java.sql package) after writing some simple JDBC programs.

For example, in java.sql, the below is the declaration:

public interface Connection extends Wrapper, AutoCloseable

So, as per my understanding, these specifications have to be implemented by database vendors, in the form of JDBC drivers.

In my sample program i used H2 db, so i downloaded the JDBC driver.

Now, this jar should have implementation of java.sql.Connection, and this is what i saw in the .jar (jdbc driver) for this (under package --> org.h2.jdbc):

public class org.h2.jdbc.JdbcConnection extends org.h2.message.TraceObject implements java.sql.Connection {

The jdbc driver jar does implement java.sql.Connection, as expected; however where does it get java.sql.Connection from? (it simply implements java.sql.Connection), where is the definition of java.sql.Connection coming from?

Any pointers to clear this doubt would be helpful.

Upvotes: 3

Views: 1773

Answers (1)

JB Nizet
JB Nizet

Reputation: 692003

It's in the JDK, since you were able to look at its documentation in the JDK javadoc.

Upvotes: 4

Related Questions