Insert Into 语句的语法错误

来源:百度知道 编辑:UC知道 时间:2024/05/09 13:27:59
public void adde() throws SQLException{
try{con=DriverManager.getConnection("jdbc:odbc:system");
String s1="'"+text1.getText().trim()+"'",
s2="'"+text2.getText().trim()+"'",
s3="'"+text3.getText().trim()+"'",
s4="'"+text4.getText().trim()+"'",
s5="'"+text5.getText().trim()+"'",
s6="'"+text6.getText().trim()+"'",
s7="'"+text7.getText().trim()+"'",
s8="'"+text8.getText().trim()+"'",
s9="'"+text9.getText().trim()+"'",
s10="'"+text10.getText().trim()+"'",
s11="'"+text11.getText().trim()+"'",
s12=&q

都加上'' 也就是

String temp="INSERT INTO order VALUES('"+s1+"','"+s2+"','"+s3+"','"+s4+"','"+s5+"','"+s6+"','"+s7+"','"+s8+"','"+s9+"','"+s10+"','"+s11+"','"+s12+"','"+s13+"','"+s14+"')";

INSERT INTO order VALUES
改成
INSERT INTO [order] VALUES
请不要使用SQL保留字