loading of multiple driver

In a server class while loading the driver

If I do -

Class.forName("driver1");

Class.forName("driver2");

Where driver1 and driver2 are two different drivers like Sybase driver,or Oracle driver and both driver present .

If I try to execute a simple SQl query ,which driver it will use ?

[374 byte] By [Rastoghaa] at [2007-11-27 8:43:56]
# 1

> In a server class while loading the driver

> If I do -

> Class.forName("driver1");

> Class.forName("driver2");

>

> Where driver1 and driver2 are two different drivers

> like Sybase driver,or Oracle driver and both driver

> present .

>

> If I try to execute a simple SQl query ,which driver

> it will use ?

To execute a query, you need to create a statement. To create a statement, you need to create a connection. While creating the connection, you specify the database to which you are connecting.

aniseeda at 2007-7-12 20:44:31 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2

> To execute a query, you need to create a statement.

> To create a statement, you need to create a

> connection. While creating the connection, you

> specify the database to which you are connecting.

Ipso Facto, for those a little "connect the dots" challenged, there is no conflict and no problem.

;-)

masijade.a at 2007-7-12 20:44:31 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3
One of the loaded drivers for the database for which a connection is obtained is used."The DriverManager attempts to select an appropriate driver from the set of registered JDBC drivers."
dvohra09a at 2007-7-12 20:44:31 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...