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

baidu_29737347 baidu_29737347 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
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();
}
本人程序
...全文
评论 2
收藏 已收藏
分享
返回顶部
baidu_29737347
Java 51,407 成员 86,130 内容