• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

unable to connect to mysql database from JSP  RSS feed

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have set the classpath of the driver ;
the filename is mysql-connector-java-3.1.0-alpha-bin.jar
i am using jakarta-tomcat as my web server

i get a driver class not found error
the driver i have specified is org.gjt.mm.mysql.Driver

plz help
 
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put mysql-connector-java-3.1.0-alpha-bin.jar in Tomcat's lib directory.
 
Joel Karimpil
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i searched and i found many lib directories.
which lib directory must i place it in?
 
Joel Karimpil
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
also, has a driver version to be compatible with a db version ?
i mean if the db is a new version and if the driver is old, is it still fine?
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Joel Karimpil:
i searched and i found many lib directories.
which lib directory must i place it in?



The real answer is 'it depends', although the short answer is that the best place is the <context>/WEB-INF/lib directory. The reason this is the best is that it gives the code the smallest scope within the app server.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Joel Karimpil:
also, has a driver version to be compatible with a db version ?
i mean if the db is a new version and if the driver is old, is it still fine?



More likely you have an old database version and a newer driver version, but they tend to be backwards-compatible and I've never had a problem with MySQL.
 
Joel Karimpil
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks,

after placing the driver in WEB-INF\lib and setting the classpath it's working pretty fine.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!