我得到一个SQL错误的语法时才当我尝试执行此代码:SQL语法错误用CREATE TABLE
CREATE TABLE ? (
ID INT(255) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
`UUID` VARCHAR(36) NOT NULL
);
我使用PreparedStatement来代替?用字符串
错误消息:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an errorin your SQL syntax; check the manual that corresponds to your MySQL serverversion for the right syntax to use near ''95f7ed55-ab3d-46f9-bffe-72bf5780a1ec' (ID INT(255) UNSIGNED AUTO_INCREMENT PRIM' at line 1
感谢您的帮助!
'标识符可以以数字开始,但除非报价可能并不仅仅在于数字。 'https://dev.mysql.com/doc/refman/5.0/en/identifiers.html –
看起来你使用单引号来指定表名'''。尝试使用反引号,看看这是否解决它。 –
你可以请把你的整个代码,使用dyanmic sql创建DDL吗? – Anil