java - Unable to use MySQL Connector/J with Servlets using TomCat -



java - Unable to use MySQL Connector/J with Servlets using TomCat -

i'm trying utilize mysql in java 8 (using eclipse luna release (4.4.0) tomcat 8.0.9 on windows 7 x64).

i set mysql-connector-java-5.1.31-bin.jar web-inf/lib directory.

when compiling project normal java application works. however, when seek utilize same code servlet, throws

java.sql.sqlexception: no suitable driver found jdbc:mysql://localhost:3306/test

moving .jar file tomcat's /lib directory didn't help either (compiling normal application still worked though).

i haven't changed anything, upgraded older combination of java, tomcat , eclipse.

apparently tomcat doesn't load library/driver correctly; ideas why might be?

compiling isn't issue; runtime problem.

the tomcat docs clear: jdbc driver jar belongs in tomcat server /lib, not web-inf/lib application.

that exception means driver class loaded, syntax of connection url string incorrect.

open mysql admin console , create sure can access database credentials you're providing app.

java mysql eclipse tomcat servlets

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -