Minecraft サーバー用のショップ プラグインを作成しようとしていますが、誰かが /purchase コマンドを実行するたびにエラーが発生します。
エラーは次のとおりです。
2012-07-03 04:27:28 [SEVERE] com.mysql.jdbc.MysqlDataTruncation: データの切り捨て: 切り捨てられた不正な DOUBLE 値: ',3' 2012-07-03 04:27:28 [重大] com.mysql.jdbc.MysqlIO.checkErrorPacket (MysqlIO.java:3591) で 2012-07-03 04:27:28 [重大] com.mysql.jdbc.MysqlIO.checkErrorPacket (MysqlIO.java:3525) で 2012-07-03 04:27:28 [重大] com.mysql.jdbc.MysqlIO.sendCommand (MysqlIO.java:1986) で 2012-07-03 04:27:28 [重大] com.mysql.jdbc.MysqlIO.sqlQueryDirect (MysqlIO.java:2140) で 2012-07-03 04:27:28 [重大] com.mysql.jdbc.ConnectionImpl.execSQL (ConnectionImpl.java:2620) で 2012-07-03 04:27:28 [重大] com.mysql.jdbc.StatementImpl.executeUpdate (StatementImpl.java:1662) で 2012-07-03 04:27:28 [重大] com.mysql.jdbc.StatementImpl.executeUpdate (StatementImpl.java:1581) で 2012-07-03 04:27:28 [重大] com.Chipmunk9998.Cod.CodCommandExecutor.onCommand (CodCommandExecutor.java:1421) で 2012-07-03 04:27:28 [重大] org.bukkit.command.PluginCommand.execute (PluginCommand.java:40) で 2012-07-03 04:27:28 [重大] org.bukkit.command.SimpleCommandMap.dispatch (SimpleCommandMap.java:166) で 2012-07-03 04:27:28 [重大] org.bukkit.craftbukkit.CraftServer.dispatchCommand (CraftServer.java:479) で 2012-07-03 04:27:28 [重大] com.Chipmunk9998.Cod.CodCommandExecutor.onCommand (CodCommandExecutor.java:1443) で 2012-07-03 04:27:28 [重大] org.bukkit.command.PluginCommand.execute (PluginCommand.java:40) で 2012-07-03 04:27:28 [重大] org.bukkit.command.SimpleCommandMap.dispatch (SimpleCommandMap.java:166) で 2012-07-03 04:27:28 [重大] org.bukkit.craftbukkit.CraftServer.dispatchCommand (CraftServer.java:479) で 2012-07-03 04:27:28 [重度] net.minecraft.server.NetServerHandler.handleCommand (NetServerHandler.java:821) で 2012-07-03 04:27:28 [重度] net.minecraft.server.NetServerHandler.chat (NetServerHandler.java:781) で 2012-07-03 04:27:28 [重度] net.minecraft.server.NetServerHandler.a (NetServerHandler.java:764) で 2012-07-03 04:27:28 [重度] net.minecraft.server.Packet3Chat.handle (Packet3Chat.java:34) で 2012-07-03 04:27:28 [重度] net.minecraft.server.NetworkManager.b (NetworkManager.java:229) で 2012-07-03 04:27:28 [重度] net.minecraft.server.NetServerHandler.a (NetServerHandler.java:113) で 2012-07-03 04:27:28 [重度] net.minecraft.server.NetworkListenThread.a (NetworkListenThread.java:78) で 2012-07-03 04:27:28 [重大] net.minecraft.server.MinecraftServer.w (MinecraftServer.java:567) で 2012-07-03 04:27:28 [重大] net.minecraft.server.MinecraftServer.run (MinecraftServer.java:459) で 2012-07-03 04:27:28 [重大] net.minecraft.server.ThreadServerApplication.run で (ソースファイル:492)
そして、ここに私のコードがあります:
if (cmdsender == null) {
File weaponFile = new File(plugin.getDataFolder(), "weapons.yml");
FileConfiguration weaponData = YamlConfiguration.loadConfiguration(weaponFile);
String sql = "UPDATE account_info SET Money = Money - "
+ weaponData.getString(args[0] + "." + args[1] + ".Price")
+ " WHERE Username = '" + args[2] + "'";
try {
plugin.st.executeUpdate(sql);
} catch (SQLException e) {
e.printStackTrace();
}
sql = "UPDATE account_info SET Bought_" + args[0] + " = Bought_" + args[0]
+ " + ," + args[1] + " WHERE Username = '" + args[2] + "'";
try {
plugin.st.executeUpdate(sql);
} catch (SQLException e) {
e.printStackTrace();
}
plugin.getServer().getPlayer(args[2]).sendMessage(
"You have successfully bought the "
+ weaponData.getString(args[0] + "." + args[1] + ".Name") + "."
);
return true;
}
グーグルで検索してみましたが、役立つものは見つかりませんでした。