-3
我想創建一個MySQL表創建MySQL表,我運行此:與Java
statement.executeUpdate("CREATE TABLE IF NOT EXISTS Library (Words, String);");
,但我得到了以下錯誤:
com.mysql.jdbc.exceptions.jdbc4.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 ' String)' at line 1
'(Words,String)'應該是什麼?兩列?或「字符串」類型的一列?因爲它的錯誤語法是 – khelwood
您需要指定列的類型,例如Words varchar(200)。一個表還應該有一個標識符列,並且字符串不應該被用作其關鍵字 – baao