It's not a secret anymore!
The moose likes JDBC and Relational Databases and the fly likes jdbc Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "jdbc" Watch "jdbc" New topic


s babu

Joined: Jul 26, 2007
Posts: 14
what is the exact difference between drivermanagerclass and datasource?
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3381

Hello "s babu",

Welcome to JavaRanch. I think you need to first adjust your display name to match with JavaRanch's policies. It should be your firstname and the lastname.

DriverManager and DataSource serve different purposes. DriverManager is used to register a driver (JDBC) for obtaining a connection from the specific database.

DataSource is used for managing the connections in an efficient manner as a connection is a costly resource.

Hope this helps you.

Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
s babu

Joined: Jul 26, 2007
Posts: 14
There is no need to register driver in the Datasource like we register in the drivermanager?

Thanks in Advance.
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

No. That will happen behind the scenes curteousy of whatever you use to provide the DataSource.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
I agree. Here's the link:
subject: jdbc
It's not a secret anymore!