急求助,jdbc问题,MySQL数据库

baidu_29737347 2015-07-11 04:00:49
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();
}
本人程序
...全文
68 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
baidu_29737347 2015-07-11
  • 打赏
  • 举报
回复
重复注入了。。。
Inhibitory 2015-07-11
  • 打赏
  • 举报
回复
i = pstmt.executeUpdate(sql); 改成 i = pstmt.executeUpdate();

50,639

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧