my dog learned polymorphism
The moose likes JDBC and Relational Databases and the fly likes java.sql.Connection ??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "java.sql.Connection ???" Watch "java.sql.Connection ???" New topic

java.sql.Connection ???

Bikash Paul
Ranch Hand

Joined: Dec 04, 2001
Posts: 342

Can any one please tell me why java.sql.Connection is a interface ?

And which class implement this Connection interface ?

Thanks & Regards
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Its vendor specific. So the interface is implemented by a class in your JDBC driver.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63548

And therein lies the complete and blinding beauty of interfaces. Despite the fact that each vendor has a unique class that implements the connection, your program doesn't need to care. Isn't that a wonderful thing?

[Asking smart questions] [About Bear] [Books by Bear]
Bikash Paul
Ranch Hand

Joined: Dec 04, 2001
Posts: 342
Hi all,

Lot of thanks for all of your's reply.

Thanks & Regards
I agree. Here's the link:
subject: java.sql.Connection ???
It's not a secret anymore!