Using tomcat 8 with Eclipse Cannot load JDBC driver class 'com.mysql.jdbc.Driver' ::: I have added mysql connecter every where and I still can't connect.
WEB-INF/lib/
Java Resources/Libraries/
tomcat/lib/ // however I don't see the jar file in my project
web.xml
Tomcat Context.xml
You can determine the version of the JDBC driver that you installed, by calling the getDriverVersion method of the OracleDatabaseMetaData class. You can also determine the version of the JDBC driver by executing the following commands: java -jar ojdbc5. jar.
Answer: SQLException occurs if there is an error in the database access or other errors related to the database. When SQLException occurs, an object of type SQLException will be passed to the catch clause.
Driver in MySQL Connector/J is com. mysql. cj. jdbc.
The configuration file is located in the MySQL program data directory (for example: C:\ProgramData\MySQL\MySQL Server 5.6 on Windows or /etc/mysql/ on Linux.
You need to add the mysql jar in classpath of Run Configurations.
To do this choose menu Run > Run Configuration > Select your Tomcat Installation and the classpath tab. Click on button Add External JARs...
Another thing you can try that worked for me is to add the mysql connector jar directly to the folder. Of course change to your environment.
C:[YOUR PATH]\apache-tomcat-8.5.24\lib
mysql-connector-java-5.1.45.jar
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With