This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

After loading many drivers how to use specific?

 
Umesh Vajpai
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
consider case-

Class.forname(Driver_1);
Class.forname(Driver_2);
Class.forname(Driver_3);

Connection con = DriverManager.getConnection(...);

Could any one tell me when i will be using con with statement then which connection will be used?
 
Jan Cumps
Bartender
Posts: 2608
14
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your driver knows that. The first driver that recognizes your connection string will do the job.
 
Peter Johnson
author
Bartender
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With the number of Ranchers who have asked this same question in the past week I am beginning to suspect that this is a school assignment.
http://www.coderanch.com/t/487913/JDBC/java/calling-classforname-twice
http://www.coderanch.com/t/487022/JDBC/java/Which-Driver-will-used
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic