File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes JDBC Connection Interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "JDBC Connection Interface" Watch "JDBC Connection Interface" New topic

JDBC Connection Interface

shyam java developer

Joined: Aug 09, 2011
Posts: 1
Why in JDBC Connection is interface?
Vijay Tidake
Ranch Hand

Joined: Nov 04, 2008
Posts: 146


Its because of each DB is vendor specific.So the class that provides you a connection object implements the Connection interface(Polymorphism).

Connection con=DriverManager.getConnection(<params>);

DriverManager.getConnection(<params>); return the object of a class(the name of a class does not matter) that implements the Connection interface

Hope this helps

The important thing is not to stop questioning.Curiosity has its own reason for existing.
I agree. Here's the link:
subject: JDBC Connection Interface
It's not a secret anymore!