You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?)' at line 1的错误,
Connection conn = jdbcUtil.getConn();
int i = 1;
String sql="insert into OCRM_ORDER_INFO(ORDER_ID,ORDER_TYPE,QUES_TYPE,SUBJECT,ORDER_STATE,PRIORITY,ORDER_DESC,ALLO_TIME,ID) values(?,?,?,?,?,?,?,?,?)";
PreparedStatement pstmt;
try {
pstmt = (PreparedStatement) conn.prepareStatement(sql);
long a=1009;
pstmt.setLong(9, a);
pstmt.setString(1, orderId);
pstmt.setString(2, orderType);
pstmt.setString(3, quesType);
pstmt.setString(4, subject);
pstmt.setString(5, "1");
pstmt.setString(6, priority);
pstmt.setString(7, orderDesc);
pstmt.setString(8,str);
i = pstmt.executeUpdate(sql);
pstmt.close();
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
i = pstmt.executeUpdate(sql); 改成 i = pstmt.executeUpdate();
重复注入了