• Post Reply Bookmark Topic Watch Topic
  • New Topic

jdbc and Driver Manager

 
Kevin Fonner
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was reading that the java.sql.DriverManager provides basic services for managing JDBC drivers. However, I can also choose not to register the driver with the DriverManager and just make a direct connection.
What am I looking at here and how do I choose whether or not to use the Driver Manager.
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I always use the DriverManager, but maybe that's because I didn't learn the other way of diong it.
Mark
 
uma sakthi
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is always good to register the drivers with the driver manager. This is a factory pattern. Good programming practice to always access the implementation( that is the driver) through a factory( that is the driver manager) . This results is low coupling
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!