Tanuj Bhatt

Greenhorn
+ Follow
since Oct 03, 2020
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Tanuj Bhatt

Tim Holloway wrote:We REALLY need to see how you are trying to execute that application.


I'm running in cmd with the class path set in environment variables.

Paul Clapham wrote:
It's true that the later versions of the JRE don't have an "ext" directory under the "lib" directory. Whether you could just create your own and carry on, or whether the extensions directory has been discontinued, I don't know. But I would recommend just putting the JDBC driver in the classpath -- everybody should know how to set up their classpath anyway.


I did attach the path to the folder also the classpath to the driver but now I know the error, I forgot to put ';' :-D.

Error is resolved now. Thanks guys for your inputs.
this is code which i used to test:


Also i now able to run the connection after changing all the path to jdk 1.8 but still i want to know how to run the mysql connection in jdk 11 and higher as per i know they don't have a separate jre folder to put connector jar file
I have installed jdk 11.0.8 and mysql. As per my knowledge i have also included the connector jar file in the classpath but when i'm trying to run the test code to check connectivity is shows this error.
java.sql.SQLException: No suitable driver found
       at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:702)
       at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:228)
       at jdbctest.main(jdbctest.java:10)