Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (13.1k points)
I have one database with me and I have successfully connect it with workbench, but whenever I tried to execute the Java code it throws an exception:

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.

Can anyone help me with this?

1 Answer

0 votes
by (26.7k points)

This exception mainly occurs due to the older versions of MySQL connector. So basically, we need to upgrade to the higher version and then it will work fine.

I hope this will help.

Want to become a Java expert? join Java Course now!!

Related questions

0 votes
1 answer
asked Feb 23, 2021 in Java by Jake (7k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Mar 6, 2021 in Java by Jake (7k points)

Browse Categories

...