i have created a program by which we can save the data into the database.front end is java swing and i am using jdk1.5.0 and back end is mysql the problem is that i not able to save the record and its showing
Java.Lang.ClassNotFoundExeption:com.mysql.jdbc.Driver
and source code is:
try{
Connection con = null;
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://localhost:3306/azim", "root", "apnaghar");
Statement st = con.createStatement();
int i= st.executeUpdate("Insert into meical(itemCode,itemName,catagory,type,suppliyer,expDate,manDate,MRP,position) values('"+t1.getText()+"','"+t2.getText()+"','"+lb1.getSelectedItem()+"','"+lb2.getSelectedItem()+"','"+t3.getText()+"','"+t4.getText()+"','"+t5.getText()+"','"+t6.getText()+"','"+t7.getText()+"')");
JOptionPane.showMessageDialog(null,"Data is successfully inserted into the database." );
st.close();
con.close();
}
catch(Exception e)
{
System.out.println(e);
}
}