[Logo]
Forums Register Login
unable to connect to mysql database from JSP
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
Put mysql-connector-java-3.1.0-alpha-bin.jar in Tomcat's lib directory.
i searched and i found many lib directories.
which lib directory must i place it in?
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?
 
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.
 
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.
thanks,

after placing the driver in WEB-INF\lib and setting the classpath it's working pretty fine.
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards



All times above are in ranch (not your local) time.
The current ranch time is
Nov 21, 2017 14:19:55.