ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nigel Parker" <>
Subject Cant access JDBC driver twice in same Ant run
Date Sun, 25 Nov 2001 21:37:58 GMT

I have recently converted the administration of my Java JDBC application to
Ant, and am very pleased with the new flexibility it gives me. One of the
reasons for doing the conversion was to automate regression tests. I have
however hit on the following problem which eludes all my attempts to get

When I run the application once in a single <target> everything works fine.
When I run the application twice in dependent targets, the second time
always fails with:

java.sql.SQLException: No suitable driver
	at java.sql.DriverManager.getConnection

Ive tried all combinations for loading the driver I can think of, like:


I tried inserting the driver name as a system property: <sysproperty
key="jdbc.drivers" value="sun.jdbc.odbc.JdbcOdbcDriver"/>

I tried also java.sql.DriverManager.getDriver("jdbc:odbc:SongFase2") just
before my call to getConnection with an identical URL. The correct driver is
returned so it must be there, but getConnection() in the second application
run still gives me the above exception.

Can someone help me and tell me what am I doing wrong?

Nigel Parker

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

View raw message