Hi everybody I am trying to do a basic library system.
the problem is:
I downloaded MySQL driver (connector/j) I copied .jar in CLASSPATH/jre/lib/ext
but it didn't work, I tried to copy the .jar in the directory of my application where I have my .java (or .class in execution time)
but when I execute the application the following error appear:
java.lang.ClassNotFoundException: Resource not found:
com/mysql/jdbc/Driver.class
this is the code:
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
aqui parece estar el error.
String url =
"jdbc:mysql://mysql.webcindario.com";
String login = "user";
String password = "password";
Connection conn =
DriverManager.getConnection(url,login,password);
if (conn != null)
{
JOptionPane.showMessageDialog(null,
"conexion", "alert", JOptionPane.ERROR_MESSAGE);
conn.close();
}
}
catch(SQLException sql)
{
sql.printStackTrace();
}
catch(ClassNotFoundException cnfe)
{
cnfe.printStackTrace();
}
catch (Exception ex) {
ex.printStackTrace();
}
Please help me
Nick