Hi, I am suing Oreilly books wrapper class for connection pool. It works
fine in the servlet class while I created a datasource using
ds = new DataSourceWrapper(jdbcDriverClassName, jdbcURL, dbUserName,
dbUserPassword);
But it doesn't work in the javabean class using the same code:
ds = new DataSourceWrapper(jdbcDriverClassName, jdbcURL, dbUserName,
dbUserPassword);
No problem while compiling. But there is run time error: No suitable
driver.
I print the stack error in the end of the message.
There should be no problem in the classpath setting. I tried to find the
driver in the javabean class and the driver can be found. Related codes:
try
{
Class.forName("org.gjt.mm.mysql.Driver");
}
catch ( ClassNotFoundException coe)
{
System.err.println("Class not found " + coe.getMessage());
}
Why it is working in servlet but not in javabean ? I've searched the
archive but couldn't find helpful information.
Any help are greatly appreciated!
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:543)
at java.sql.DriverManager.getConnection(DriverManager.java:183)
at org.ibiblio.sql.ConnectionPool.<init>(ConnectionPool.java:38)
at
org.ibiblio.sql.DataSourceWrapper.<init>(DataSourceWrapper.java:21)
at
org.ibiblio.osprey.DataSourceBean.getMaxID(DataSourceBean.java:34)
at org.ibiblio.osprey.TestDataSource.main(TestDataSource.java:16)
Regards,
Meichun
--
Meichun Li
Ibiblio.org
919-962-5646
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>