Inserting into database through swing
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()+"',"
System.out.println("sql insert statement");
I cant see any syntax error in the above statement.
Any help appreciated
Re: Inserting into database through swing
Please see the announcements page for the use of code tags.
Any time you have an error please post the error message with your question. Error messages have this bad habit of telling what is wrong, and with that we can more easily help you