ClassNotFoundException ???
completely new to this part, and took the code with only slight changed from a book so ..
heres what i have
Code :
private static Connection getConection(){
Connection conect = null;
try {
Class.forName("com.mysql.jdbc.Driver");
String url = "jdbc:mysql://localhost/players";
String user = "root";
String pw = "********";
conect = DriverManager.getConnection(url, user, pw);
}catch(ClassNotFoundException e){
System.out.println("Class not Found: " + e.getMessage());
System.exit(0);
}catch(SQLException e){
System.out.println("SQL Error: " + e.getMessage());
System.exit(0);
}
return conect;
}
and i get "Class not Found: com.mysql.jdbc.Driver" when i run it . why doesn't it work ?
notes:
i just installed the mysql java connection
and installed some kind of java database that i though i needed XP
[ >.< it was an eclipse problem XP , i didnt load the jar file to there thinking it wold just recognize it *fails* ]
Re: ClassNotFoundException ???
You need the MySQL connector jar file on your classpath.
// Json
1 Attachment(s)
Re: ClassNotFoundException ???
i had just put that in b4 i started coding that
but encase i did it wrong heres a pic of where i put it and the value of the Classpath var
it still doesnt work even though i have that