Hi,
I am trying to insert data into database throgh swing. I am able to connect to database but while executing the query I am getting sql exception.
My code is as follow.
String sql="INSERT INTO student(StudentID,Name,Address,FName,Sex,DOB,Branc h) "
+ "VALUES ('"+tfsid+"','"+tffname.getText()+"','"+taadd.getT ext()+"','"+tflname.getText()+"','"+tfgender.getTe xt()+"',"
+ "'"+tfdob+"','"+tfbranch.getText()+"')";
System.out.println("sql insert statement");
stmt.executeUpdate(sql);
I cant see any syntax error in the above statement.
Any help appreciated
Thanks!!!!