Hey I am new to java and is right now learning about JDBC. Well i have written this code to create a connection to the sql server where my database is located :
import java.sql.*;
public class Mysql
{
public static void getmysqlconnection()
{
try
{
Connection con = null;
Class.forName("com.mysql,jdbc.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost/EMP","root","password");
System.out.println("connection created");
}
catch(SQLException se)
{
System.out.println("SQl Exception" + se);
}
catch(ClassNotFoundException e)
{
System.out.println("ClassNotFoundException" + e);
}
}
public static void main(String args[])
{
getmysqlconnection();
}
}
But on compiling it is generating the following error : ClassNotFoundExceptionjava.lang.ClassNotFoundException: com.mysql.jdbc.Driver