con = Connect.ConnectDB();
String sql = "insert into table1 ("
+"StudentID,"
+"FirstName,"
+"LastName,"
+"Contact Number,"
+"E-mail address,"
+"CarNumber)"
+ "values("+txtid.getText()+ ",'"+txtname.getText()+"','"+txtlast.getText()+"','"+txtnumber.getText()+"','"+txtemail.getText()+"','"+txtcarno.getText()+"')" ;
try{
pst = con.prepareStatement(sql);
pst.execute();
JOptionPane.showMessageDialog(null, "Saved");
}
catch(Exception e){
JOptionPane.showMessageDialog(null, e);
}
can any one help me with this? im getting syntax error in insert into statement ..
Tq