This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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 ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Implementing Class
 
Similar Threads
Interface
what we should do with interface when create jar file ?
jdbc
Query on Connection interface
java.lang.Object is a class or Interface