Hi,
We have the following code that runs in Linux Ubuntu, but not on Windows XP or Windows 7.
Do you know what could be the problem?
Here's the code snippet:
if (logger.isDebugEnabled())
{
logger.debug("before getting connection");
}
String url = "jdbc:mysql://XXX.XXX.XXX.XXX";
Connection conn = DriverManager.getConnection(url,"XXXX","XXXX");
if (logger.isDebugEnabled())
{
logger.debug("after getting connection");
}
Here are the logs, it can't find the driver.
0 [main] DEBUG main.Query1 - this is a sample log message.
0 [main] DEBUG main.Query1 - logger is enabled for sure
0 [main] DEBUG main.Query1 - before getting connection
16 [main] ERROR main.Query1 - Got an exception!
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:545)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at main.Query1.testQuery(Query1.java:41)
at main.Query1.main(Query1.java:21)
In our build path, we have:
- mysql-connector-java-5.1.13-bin.jar
- log4j-1.2.16.jar
Thanks.