Cita:
ya he importado la libreria del driver que se baja de la pagina de mysql y todo pero aun me sigue saltando el error, java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost/descargamusica?user=root&password=adminadmin1
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at com.pablo.Conexion.<init>(Conexion.java:11)
at com.pablo.GreetingServlet.doPost(GreetingServlet.j ava:64)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at com.pablo.Conexion.<init>(Conexion.java:11)
at com.pablo.GreetingServlet.doPost(GreetingServlet.j ava:64)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
Esta relacionado con el tomcat?
(todo corre localmente, tanto tomcat como el servidor mysql)
Estoy trabajando en eclipse.
aca hay a screen de mi proyecto
y el codigo de la conexion
Cita:
package com.pablo;
import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
public class Conexion {
public Conexion(){
System.out.println("hola");
Connection con=null;
try {
con=DriverManager.getConnection("jdbc:mysql://localhost/descargamusica?user=root&password=adminadmin1");
System.out.println(con.getCatalog());
Statement st=con.createStatement();
st.executeUpdate("insert into usuarios values ('cira223','rojas')");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("Todo Bien");
}
}
import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
public class Conexion {
public Conexion(){
System.out.println("hola");
Connection con=null;
try {
con=DriverManager.getConnection("jdbc:mysql://localhost/descargamusica?user=root&password=adminadmin1");
System.out.println(con.getCatalog());
Statement st=con.createStatement();
st.executeUpdate("insert into usuarios values ('cira223','rojas')");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("Todo Bien");
}
}
Desde ya como siempre gracias por la respuesta.