0

the following error i am getting;

type Exception report

messageInternal Server Error

descriptionThe server encountered an internal error that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/chh-cw
root cause

java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/chh-cw

the following is my project structure:

enter image description here

is this the correct path to put the external jars??

Roshan
  • 645
  • 1
  • 11
  • 36

2 Answers2

1

It depends. Who is actually creating the connection? If your application code is directly, then the JAR belongs in WEB-INF/lib. If your container is managing the connections through a JNDI resource, then the JAR needs to be in the Glassfish classpath, not WEB-INF/lib.

In Glassfish 3.x I put the JARs in domain/lib/ext or something like that.

wrschneider
  • 17,913
  • 16
  • 96
  • 176
0

yes - if you do your Connection in an may LoginServerlet... with Code like this:

this.conn = DriverManager.getConnection(getConnString());

you only have to copy the mysql..connector.jar to the WEB-Inf/lib Folder or your Domain.