hai friends
i am new to java and mysql.i have created stored procedures in mysql.Now i want to call that stored procedures in java.All works fine.but it show the following error.
unreported exception java.lang.Insta ntiationExcepti on; must be caught or declared to be thrown
Class.forName ("com.mysql.jdb c.Driver").newI nstance();
I need code sample along with connection string.please.. ..
My codings here
CallableStateme nt proc = null;
try
{
String url = "jdbc:mysql ://localhost/Test_DB";
Class.forName ("com.mysql.jdb c.Driver").newI nstance();
Connection conn = DriverManager.g etConnection (url, "root", "");
proc = conn.prepareCal l("{ call sp_InsertEmploy ee('"+EmployeeC ode+"','"+Emplo yeeName+"','"+D esignation+"', '"+Department+" ') }");
proc.execute();
proc.close();
conn.close();
}
catch (SQLException e)
{
}
i am new to java and mysql.i have created stored procedures in mysql.Now i want to call that stored procedures in java.All works fine.but it show the following error.
unreported exception java.lang.Insta ntiationExcepti on; must be caught or declared to be thrown
Class.forName ("com.mysql.jdb c.Driver").newI nstance();
I need code sample along with connection string.please.. ..
My codings here
CallableStateme nt proc = null;
try
{
String url = "jdbc:mysql ://localhost/Test_DB";
Class.forName ("com.mysql.jdb c.Driver").newI nstance();
Connection conn = DriverManager.g etConnection (url, "root", "");
proc = conn.prepareCal l("{ call sp_InsertEmploy ee('"+EmployeeC ode+"','"+Emplo yeeName+"','"+D esignation+"', '"+Department+" ') }");
proc.execute();
proc.close();
conn.close();
}
catch (SQLException e)
{
}
Comment