String s1=t1.getText();//book code integer
String s2=t2.getText();//book name varchar
String s3=t3.getText();//student name varchar
String s4=t4.getText();//class varchar
String s5=t5.getText();//roll no varchar
String s6=t6.getText();//issue date varchar
String s7=t7.getText();//return date varchar
String sql="update lib set book_code ='"+s1+"' ,book_name ='"+s2+"' ,student_name='"+s3+"' ,class ='"+s4+"' ,roll_no ='"+s5+"' ,issue_date ='"+s6+"' ,return_date ='"+s7+"' where book_code ='"+s1+"' ";
pst=con.prepareStatement(sql);
pst.execute();
JOptionPane.showMessageDialog(null,"the table has been updated");
抱歉,我知道这是一个愚蠢的问题,但请有人在查询部分帮助我,请让我知道最可能的查询部分出了什么问题。