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 Implementing Class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Implementing Class" Watch "Implementing Class" New topic

Implementing Class


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

Joined: Mar 06, 2001
Posts: 13459

The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at
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.
David O'Meara

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'.
[ September 03, 2002: Message edited by: David O'Meara ]
subject: Implementing Class
It's not a secret anymore!