That's what it sounds like. For some reason your bean class can't see the
driver.
Tim


-----Original Message-----
From: Meichun Li [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 17, 2002 12:20 PM
To: Tomcat Users List; [EMAIL PROTECTED]
Subject: RE: No suitable driver

On Wed, 17 Jul 2002, The Kelley's wrote:

> I had a problem somewhat simular to that.
> Make sure you  have access to the driver in the bean class.
> Maybe a required library or something.
> Tim

Thanks for the reply. Could you explain more detail about the access to
the driver?

In my bean class, if using the standard JDBC connection instead of using
the datasource, there is no probelm. Is this mean that my bean class could
access to the driver?

Thanks,

Meichun

>
> -----Original Message-----
> From: Meichun Li [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 17, 2002 12:01 PM
> To: Tomcat Users List
> Subject: No suitable driver
>
> 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]>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>

--
Meichun Li
Ibiblio.org
919-962-5646


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to