语句数据库可以执行成功 tomcat报错 急!坐等
jsp吧
全部回复
仅看楼主
level 3
关键代码
String sql = "select * from wuliu.order where orderid = ? ";
PreparedStatement ps = conn.prepareStatement(sql);
ps.setInt(1,Integer.parseInt(orderid));
ResultSet rs=ps.executeQuery(sql);
错误信息: 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
2013年07月01日 02点07分 1
level 3
是不是问号用全角而不是半角了
2013年07月02日 13点07分 2
是半角
2013年07月02日 16点07分
很诡异,代码直接以java运行,可以查询成功
2013年07月02日 16点07分
level 3
之前常不小心出错是 sql语句后面加了;
2013年07月03日 03点07分 3
level 1
con吧应该、
2013年07月08日 15点07分 4
1