GeeCON Prague 2014*
The moose likes JDBC and the fly likes Implementing Class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "Implementing Class" Watch "Implementing Class" New topic
Author

Implementing Class

tomas
Greenhorn

Joined: Aug 29, 2002
Posts: 2
The interfaces like COnnection,Statement,Prepared Statement,ResultSet etc should hava an implementation class.Can anyone please tell me which is the class that implements these interfaces
Thanks in advance
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

"tomas",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp.
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please edit your profile and select a new name which meets the requirements.
Thanks.
Dave
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

JDBC does things a little differently, in that it tries to hide these details so that you never know them. The advantage is that if only know the generic behaviour of a Class and not its specifics, you can swap in any Class that behaves the same way.
This reduces coupling with a single database since (in theory) you should be able to swap directly to another one.
The reality is a little different.
That is why you will generally see code like this:

The only 'concrete' class is the DriverManager. Each database Driver should register itself with the manager (this happens in the 'forName' bit)
The DriverManager hands back a specific class type, but you only know it is a 'Connection'.
Dave
[ September 03, 2002: Message edited by: David O'Meara ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Implementing Class