Thread: Mysql problem
View Single Post
  #1 (permalink)  
Old 05-15-2007, 04:06 PM
Nick15 Nick15 is offline
Member
 
Join Date: May 2007
Posts: 39
Nick15 is on a distinguished road
Mysql problem
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:
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

Last edited by Nick15 : 06-01-2007 at 02:41 AM.
Reply With Quote
Sponsored Links