• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Tomcat4 cann't find MySQL driver

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
why cann't Tomcat4 find MySQL driver which I put in WEB-INF\classes directory?
my bean words fine as a standalone application(CLASSPATH setting is fine), but when I try to use it in my JSP page, Tomcat just cann't find the Driver class, even thought I put org.git.mm.mysql directory structure under my web applicaiton's WEB-INF\classes directory.
Class.forName("org.gjt.mm.mysql.Driver").newInstance();

Help please!!! I have been working on it for the past 2 days ( without sleep).
 
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI,
Yes I just installed Tomcat 4.0 and the documentation doesn't say exactly what dir to put the MySQL driver in.
Anyone got it working who could tell us where to put it? (the file that is )
Bye,

------------------
Terry Doyle
Sun Certified Programmer for Java 2 Platform
 
Terence Doyle
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
UPDATE:
Further testing and searching in the MySQL driver suggested long filename in CLASSPATH might be responsible so I altered the driver directory but it still doesn't work!.
BTW I'm trying on both W98 and Linux (Suse 7.2 Professional) as I have each OS installed on a separate hard disk. I have jswdk-1.0 working perfectly under both OS with database access but it doesn't support latest JSP and Servlet features and it's slow - very slow.
Any help will be apreciated.
Thanks,
Terry
 
Terence Doyle
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI,
Just brining this up tio the top again as I still haven't found the solution.
As far as I can see the MySQL dirver has to be in the classpath for Sun's JSWDK-1.0 server to work ( and it does ), so why can't Tomcat find it?

Anyone out there see what I'm doing wrong?

Thanks,
------------------
Terry Doyle
Sun Certified Programmer for Java 2 Platform
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I put the My Sql driver into the Jakarta\lib directory.
 
Terence Doyle
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much Steve.
I found a reference to putting the .jar file in the lib directory on a help page elsewhere yesterday and it's now working fine.
Terry
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According to the documentation the driver can be placed in several places under tomcat depending on your intention. The $CATALINA_HOME/common/lib directory an area where you can place jar files if you intend to share it amoungst other applications that you might create under tomcat 4.x. If you intend to use the driver specifically for an application and not share it out, then create a lib directory under the WEB-INF directory of your application (context) and place it there. I currently have my mm.mysql-2.0.6.jar file located in the D:\Apache Tomcat 4.0\common\lib area on windows 2000.
 
reply
    Bookmark Topic Watch Topic
  • New Topic