my code not work java and jsp plz help me
public class DbConnect {
Connection conn = null;
ResultSet rst;
java.sql.Statement stmt;
String url="jdbc:mysql://localhost:3306/";
String dbName="teljo";
String driver="com.mysql.jdbc.Driver";
String userName="root";
String password="";
public Connection getConnect(){
try {
Class.forName(driver).newInstance();
System.out.println("driver loaded sucessfully");
conn=DriverManager.getConnection(url + dbName,userName,password);
System.out.println("connect to the data base");
}
catch (ClassNotFoundException ce) {
System.out.println("driver loading failed"+ ce);
}
catch (Exception e) {
System.out.println("error in connection to database");
}
return conn;
}
}
this is my connection code db class. the mysql connection notconnect what is do? i using eclipse IDE, output is this
driver loading failedjava.lang.ClassNotFoundException: com.mysql.jdbc.Driverjava.lang.NullPointerException