'No suitable driver found' error for usin

2019-07-19 16:29发布

问题:

I have a Java Web Application and using an operation of it from a consumer Java App i want to handle a MySQL database. When i am trying to get a connection to the database i get a:

No suitable driver found for jdbc:mysql://localhost:3306/mysql

I have put the JDBC connector jar to the classpath of both my Web App and the Java App that tries to consume the Web Service. I am using NetBeans IDE.

回答1:

Put the connector in the glassfish/lib folder and restart the server.