我有查询
INSERT INTO tests2 (`name`, `val1`, `val2`, `val3`, `rotation~time`, `rotation~messages~countdown_format`, `rotation~messages~messages`) VALUES ('Testing', 'Test', 'false', '0', '21', 'Value', '[[Value 1, Value 2]]')
这在 phpMyAdmin 中工作正常,但它给出了一个例外:
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 ')' at line 1
在java中调用时使用
statement.execute(query);
(我使用这种方法创建连接:)
connection = DriverManager.getConnection(getJDBCString(settings.host(), settings.port(), settings.database()), settings.username(), settings.password());
statement = connection.createStatement();
怎么了?
编辑:
我打算将整数和布尔值保存为字符串
我还尝试将坟墓 (`) 换成 ' 和 "