Bom dia…
É o seguinte, eu tenho o seguinte fabrica de conexão com o banco:
public class FabricaDeConexao {
private Connection con;
public Connection getConnectionFactory(){
try {
try {
Class.forName("com.mysql.Driver");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return con = DriverManager.getConnection("jdbc:mysql://localhost/incriveis", "", "1234");
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
}
Mas esta gerando o Erro abixo:
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
java.lang.RuntimeException: java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost/incriveis
br.com.incriveisvip.conexao.FabricaDeConexao.getConnectionFactory(FabricaDeConexao.java:23)
br.com.incriveisvip.DAO.IntegranteDAO.(IntegranteDAO.java:19)
br.com.incriveisvip.servlets.IncriveisServlet.doPost(IncriveisServlet.java:41)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost/incriveis
java.sql.DriverManager.getConnection(Unknown Source)
java.sql.DriverManager.getConnection(Unknown Source)
br.com.incriveisvip.conexao.FabricaDeConexao.getConnectionFactory(FabricaDeConexao.java:20)
br.com.incriveisvip.DAO.IntegranteDAO.(IntegranteDAO.java:19)
br.com.incriveisvip.servlets.IncriveisServlet.doPost(IncriveisServlet.java:41)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.32 logs.
Podem me ajudar a resolve-lo?
desde de já fico grato!!
Abraços