This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Implementing Class

 
tomas
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic