You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Power-Netz (Schwarz)" <sc...@power-netz.de> on 2002/06/14 11:52:29 UTC

AW: Error found while connecting to mysql from JSP page deployedontomcat

>
> Hi,
>
> I have installed tomcat on HP-UX box.I have deployed my web application
> on tomcat container.I have copied mysql JDBC driver under common/lib
> area.
>
> While running the application i am getting following error ....
>
> Cannot load JDBC driver class 'null'
> java.lang.NullPointerException:
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Unknown Source)


Your code is missing this :

try { Class.forName(drivername); } catch (Exception e) {
System.out.println("failed to load Driver:"+drivername); }

where drivername is "org.gjt.mm.mysql.Driver" OR the other mysqljdbc
package!



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>