Hii Learn Vern Since I am going through one of webinar on inventory management application i am getting an error, again and again, could you please guide me through it. below I added the code and preformatted specific lines on code. Thanks
try {
Class.forName(“com.mysql.jdbc.Driver”);
Connection con = DriverManager.getConnection(“jdbc:mysql://localhost:3306/inventory”, “root”, “”);
System.out.println(“connection establish”);
Statement st =`con.createStatement();`
String qry = "insert into stock(stockname,qty,price) value('"+stockname+"',"+qty+","+price+")";
int x = `st.executeUpdate(qry);`
if(x>0)
{
JOptionPane.showInputDialog(AddStock.this, "Stock Added" );
new HomePage();
frame.dispose();
}
con.close();
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}