Hi...I'm trying to connect my web-application to MySql (database), from
ECLIPSE I am getting a runtime error stating :java.lang.ClassNotFoundException: com.mysql.jdbc.Driver.
I have added the eternal (JAR file) mysql-connector-java-5.1.22.zip. But still I'm getting the error.
The code:
Connection con = null;
try
{
Class.forName("com.mysql.jdbc.Driver"); //
This is where the run-time error occurs (ClassNotFoundException)
con = DriverManager.getConnection("jdbc:mysql://localhost:3306/brb","root","123");
Statement st = con.createStatement();
st.executeUpdate("insert into
test values('" + name + "','"+ value +"')");
}catch(Exception e)
Note: This works absolutely fine on NetBeans....