This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes JDBC 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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC Connection Interface" Watch "JDBC Connection Interface" New topic
Author

JDBC Connection Interface

shyam java developer
Greenhorn

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

Joined: Nov 04, 2008
Posts: 146

Hi,

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
Thanks


The important thing is not to stop questioning.Curiosity has its own reason for existing.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC Connection Interface
 
Similar Threads
How do you have an object of an Interface
how can i lock database programmatically?
Regarding Connection interface
how can i lock database programmatically?
Connection con = new Connection()