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中执行,一点问题也没有,成功的添加了列,这是什么情况???
catspeake
茅侃侃
相关分类