aspose file tools*
The moose likes JDBC and the fly likes After loading many drivers how to use specific? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "After loading many drivers how to use specific?" Watch "After loading many drivers how to use specific?" New topic
Author

After loading many drivers how to use specific?

Umesh Vajpai
Greenhorn

Joined: Mar 14, 2010
Posts: 26
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

Joined: Dec 20, 2006
Posts: 2477
    
    7

Your driver knows that. The first driver that recognizes your connection string will do the job.


OCUP UML fundamental and ITIL foundation
youtube channel
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5779
    
    7

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


JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: After loading many drivers how to use specific?
 
Similar Threads
Connection through DSN
How to connect to MS ACCESS through our own Driver
Tomcat not loading mysql database driver
Loading file data into a DB2 table using java
Connecting with SQL 2000