Win a copy of Functional Reactive Programming this week in the Other Languages 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: 2602
13
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: 5852
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