· 7 years ago · Dec 10, 2018, 09:04 AM
1com.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 ''{"nexus_loc":{"world":"world","x":300.0,"y":63.0,"z":428.0,"pitch":0.0,"yaw":0.' at line 1
2
3PreparedStatement stmt = conn.prepareStatement("INSERT INTO %table VALUES (?,?) ON DUPLICATE KEY UPDATE `data` = VALUES(?)".replace("%table",tablename));
4 stmt.setString(1,key);
5 stmt.setString(2,serialize(value,type));
6 stmt.setString(3,serialize(value,type));
7 stmt.executeUpdate();
8 stmt.close();
9
10String tablequery = "CREATE TABLE IF NOT EXISTS %table (`id` CHAR(36) PRIMARY KEY, `data` TEXT);".replace("%table",tablename);