I have tried a lot for JDBC using mysql but none of them work....
Can anyone help me how to get this work....
import java.sql.Connection;
import java.sql.DriverManager;
public class Main {
public static void main(String[] argv) throws Exception {
String driver = "com.mysql.jdbc.Driver";
String connection = "jdbc:mysql://localhost:3306/abc";
String user = "root";
String password = "password";
Class.forName(driver);
Connection con = DriverManager.getConnection(connection, user, password);
if (!con.isClosed()) {
con.close();
}
}
}
I have downloaded com.mysql.jdbc.driver file.
included in my classpath but still i am getting the classnotfound error for "com.mysql.jdbc.Driver'.