commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dhananjay Makwana" <>
Subject [dbcp] Problem getting Connection with multiple JDBC drivers
Date Wed, 20 Sep 2006 20:46:05 GMT
Hi All, 

I have a component that uses commons-dbcp for JDBC connection pooling while
talking to multiple databases. The component runs in "home-grown"
application server. Each application in the server may talk to a particular
database (oracle or SQL Server). I have two separate JDBC drivers (say A and
B) on the classpath of app-server. Thus, I can run different apps talking to
oracle (using driver A) and SQL Server (using driver B). 

I am using BasicDataSource class to create connection. The problem is that
driver B has a bug where for Driver.acceptsURL() method it throws a NPE. Now
when I call BasicDataSource.getConnection() it calls above method for driver
B and fails. So my question is that, in commons-dbcp, can I do something as
a workaround? 

Even though I am creating BasicDataSource and providing "driver class",
"JDBC URL", "user name" and "password", I am guessing it scans the classpath
to create the Driver. I tried setting "jdbc.drivers" property to just driver
A but dbcp still scans for all drivers. 

Appreciate any help. 


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message