This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DriverManager iterating through driver lists, will it create an overhead ?

 
Shekhar Pareek
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Folks, i read this on a website:

"You need a database connection to manipulate the database. In order to create the connection to the database, the DriverManager class has to know which database driver you want to use.
It does that by iterating over the array (internally a Vector) of drivers that have registered with it and calls the acceptsURL(url) method on each driver in the array, effectively asking the driver to tell it whether or not it can handle the JDBC URL. "

So does it mean whenever we try to create a db connection, the driver manager would iterate through the entire list of drivers which have registered ??
In case the number of drivers registered are substantial, won't this create an overhead ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic