Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jdbc

 
s babu
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the exact difference between drivermanagerclass and datasource?
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
s babu
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no need to register driver in the Datasource like we register in the drivermanager?

Thanks in Advance.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. That will happen behind the scenes curteousy of whatever you use to provide the DataSource.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic