PreparedStatement pt2=conn.prepareStatement("alter table tb_main add column ? INT");pt2.setString(1,“itemA”);pt2.execute();这是我的代码,每次执行都会抛出MySQLSyntaxErrorException: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 ''itemA' INT' at line 1这样的异常,所以我就用同样的语句到mysql的command line client中执行,一点问题也没有,成功的添加了列,这是什么情况???
添加回答
举报
0/150
提交
取消