[Urgent] SQL ERROR?

Discussion in 'Plugin Development' started by MCMatters, Jun 19, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    MCMatters

    Code:error
    1. 19.06 21:57:35 [Server] INFO at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628) [spigot.jar:git-Spigot-1451]
    2. 19.06 21:57:35 [Server] INFO at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:482) [spigot.jar:git-Spigot-1451]
    3. 19.06 21:57:35 [Server] INFO at net.minecraft.server.v1_7_R3.MinecraftServer.u(MinecraftServer.java:576) [spigot.jar:git-Spigot-1451]
    4. 19.06 21:57:35 [Server] INFO at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:283) [spigot.jar:git-Spigot-1451]
    5. 19.06 21:57:35 [Server] INFO at net.minecraft.server.v1_7_R3.MinecraftServer.v(MinecraftServer.java:713) [spigot.jar:git-Spigot-1451]
    6. 19.06 21:57:35 [Server] INFO at net.minecraft.server.v1_7_R3.ServerConnection.c(ServerConnection.java:77) [spigot.jar:git-Spigot-1451]
    7. 19.06 21:57:35 [Server] INFO at net.minecraft.server.v1_7_R3.NetworkManager.a(NetworkManager.java:176) [spigot.jar:git-Spigot-1451]
    8. 19.06 21:57:35 [Server] INFO at net.minecraft.server.v1_7_R3.PacketPlayInChat.handle(PacketPlayInChat.java:65) [spigot.jar:git-Spigot-1451]
    9. 19.06 21:57:35 [Server] INFO at net.minecraft.server.v1_7_R3.PacketPlayInChat.a(PacketPlayInChat.java:28) [spigot.jar:git-Spigot-1451]
    10. 19.06 21:57:35 [Server] INFO at net.minecraft.server.v1_7_R3.PlayerConnection.a(PlayerConnection.java:830) [spigot.jar:git-Spigot-1451]
    11. 19.06 21:57:35 [Server] INFO at net.minecraft.server.v1_7_R3.PlayerConnection.handleCommand(PlayerConnection.java:985) [spigot.jar:git-Spigot-1451]
    12. 19.06 21:57:35 [Server] INFO at org.bukkit.craftbukkit.v1_7_R3.CraftServer.dispatchCommand(CraftServer.java:722) [spigot.jar:git-Spigot-1451]
    13. 19.06 21:57:35 [Server] INFO at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:180) [spigot.jar:git-Spigot-1451]
    14. 19.06 21:57:35 [Server] INFO at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) [spigot.jar:git-Spigot-1451]
    15. 19.06 21:57:35 [Server] INFO at com.mcmnetwork.pda.PDA.onCommand(PDA.java:29) [questioncraft.jar:?]
    16. 19.06 21:57:35 [Server] INFO at com.mcmnetwork.pda.PDA.openPDA(PDA.java:48) ~[questioncraft.jar:?]
    17. 19.06 21:57:35 [Server] INFO at com.mcmnetwork.pda.PDA.getTokens(PDA.java:68) ~[questioncraft.jar:?]
    18. 19.06 21:57:35 [Server] INFO at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1388) ~[spigot.jar:git-Spigot-1451]
    19. 19.06 21:57:35 [Server] INFO at com.mysql.jdbc.StatementImpl.checkForDml(StatementImpl.java:434) ~[spigot.jar:git-Spigot-1451]
    20. 19.06 21:57:35 [Server] INFO at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927) ~[spigot.jar:git-Spigot-1451]
    21. 19.06 21:57:35 [Server] INFO at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982) ~[spigot.jar:git-Spigot-1451]
    22. 19.06 21:57:35 [Server] INFO at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987) ~[spigot.jar:git-Spigot-1451]
    23. 19.06 21:57:35 [Server] INFO at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073) ~[spigot.jar:git-Spigot-1451]
    24. 19.06 21:57:35 [Server] INFO java.sql.SQLException: Can not issue data manipulation statements with executeQuery().
    25. 19.06 21:57:35 [Server] INFO [21:57:35 ERROR]: null
    26. 19.06 21:57:34 [Server] INFO at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628) [spigot.jar:git-Spigot-1451]
    27. 19.06 21:57:34 [Server] INFO at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:482) [spigot.jar:git-Spigot-1451]
    28. 19.06 21:57:34 [Server] INFO at net.minecraft.server.v1_7_R3.MinecraftServer.u(MinecraftServer.java:576) [spigot.jar:git-Spigot-1451]
    29. 19.06 21:57:34 [Server] INFO at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:283) [spigot.jar:git-Spigot-1451]
    30. 19.06 21:57:34 [Server] INFO at net.minecraft.server.v1_7_R3.MinecraftServer.v(MinecraftServer.java:713) [spigot.jar:git-Spigot-1451]
    31. 19.06 21:57:34 [Server] INFO at net.minecraft.server.v1_7_R3.ServerConnection.c(ServerConnection.java:77) [spigot.jar:git-Spigot-1451]
    32. 19.06 21:57:34 [Server] INFO at net.minecraft.server.v1_7_R3.NetworkManager.a(NetworkManager.java:176) [spigot.jar:git-Spigot-1451]
    33. 19.06 21:57:34 [Server] INFO at net.minecraft.server.v1_7_R3.PacketPlayInChat.handle(PacketPlayInChat.java:65) [spigot.jar:git-Spigot-1451]
    34. 19.06 21:57:34 [Server] INFO at net.minecraft.server.v1_7_R3.PacketPlayInChat.a(PacketPlayInChat.java:28) [spigot.jar:git-Spigot-1451]
    35. 19.06 21:57:34 [Server] INFO at net.minecraft.server.v1_7_R3.PlayerConnection.a(PlayerConnection.java:830) [spigot.jar:git-Spigot-1451]
    36. 19.06 21:57:34 [Server] INFO at net.minecraft.server.v1_7_R3.PlayerConnection.handleCommand(PlayerConnection.java:985) [spigot.jar:git-Spigot-1451]
    37. 19.06 21:57:34 [Server] INFO at org.bukkit.craftbukkit.v1_7_R3.CraftServer.dispatchCommand(CraftServer.java:722) [spigot.jar:git-Spigot-1451]
    38. 19.06 21:57:34 [Server] INFO at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:180) [spigot.jar:git-Spigot-1451]
    39. 19.06 21:57:34 [Server] INFO at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) [spigot.jar:git-Spigot-1451]
    40. 19.06 21:57:34 [Server] INFO at com.mcmnetwork.pda.PDA.onCommand(PDA.java:29) [questioncraft.jar:?]
    41. 19.06 21:57:34 [Server] INFO at com.mcmnetwork.pda.PDA.openPDA(PDA.java:48) ~[questioncraft.jar:?]
    42. 19.06 21:57:34 [Server] INFO at com.mcmnetwork.pda.PDA.getTokens(PDA.java:68) ~[questioncraft.jar:?]
    43. 19.06 21:57:34 [Server] INFO at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1388) ~[spigot.jar:git-Spigot-1451]
    44. 19.06 21:57:34 [Server] INFO at com.mysql.jdbc.StatementImpl.checkForDml(StatementImpl.java:434) ~[spigot.jar:git-Spigot-1451]
    45. 19.06 21:57:34 [Server] INFO at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927) ~[spigot.jar:git-Spigot-1451]
    46. 19.06 21:57:34 [Server] INFO at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982) ~[spigot.jar:git-Spigot-1451]
    47. 19.06 21:57:34 [Server] INFO at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987) ~[spigot.jar:git-Spigot-1451]
    48. 19.06 21:57:34 [Server] INFO at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073) ~[spigot.jar:git-Spigot-1451]
    49. 19.06 21:57:34 [Server] INFO java.sql.SQLException: Can not issue data manipulation statements with executeQuery().
    50. 19.06 21:57:34 [Server] INFO [21:57:34 ERROR]: null
    51. 19.06 21:57:34 [Server] INFO [21:57:34 INFO]: [WorldEdit] Using external NmsBlock for this version: CBXNmsBlock_175_5xcompat
    52. 19.06 21:57:33 [Server] INFO at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628) [spigot.jar:git-Spigot-1451]
    53. 19.06 21:57:33 [Server] INFO at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:482) [spigot.jar:git-Spigot-1451]
    54. 19.06 21:57:33 [Server] INFO at net.minecraft.server.v1_7_R3.MinecraftServer.u(MinecraftServer.java:576) [spigot.jar:git-Spigot-1451]
    55. 19.06 21:57:33 [Server] INFO at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:283) [spigot.jar:git-Spigot-1451]
    56. 19.06 21:57:33 [Server] INFO at net.minecraft.server.v1_7_R3.MinecraftServer.v(MinecraftServer.java:713) [spigot.jar:git-Spigot-1451]
    57. 19.06 21:57:33 [Server] INFO at net.minecraft.server.v1_7_R3.ServerConnection.c(ServerConnection.java:77) [spigot.jar:git-Spigot-1451]
    58. 19.06 21:57:33 [Server] INFO at net.minecraft.server.v1_7_R3.NetworkManager.a(NetworkManager.java:176) [spigot.jar:git-Spigot-1451]
    59. 19.06 21:57:33 [Server] INFO at net.minecraft.server.v1_7_R3.PacketPlayInChat.handle(PacketPlayInChat.java:65) [spigot.jar:git-Spigot-1451]
    60. 19.06 21:57:33 [Server] INFO at net.minecraft.server.v1_7_R3.PacketPlayInChat.a(PacketPlayInChat.java:28) [spigot.jar:git-Spigot-1451]
    61. 19.06 21:57:33 [Server] INFO at net.minecraft.server.v1_7_R3.PlayerConnection.a(PlayerConnection.java:830) [spigot.jar:git-Spigot-1451]
    62. 19.06 21:57:33 [Server] INFO at net.minecraft.server.v1_7_R3.PlayerConnection.handleCommand(PlayerConnection.java:985) [spigot.jar:git-Spigot-1451]
    63. 19.06 21:57:33 [Server] INFO at org.bukkit.craftbukkit.v1_7_R3.CraftServer.dispatchCommand(CraftServer.java:722) [spigot.jar:git-Spigot-1451]
    64. 19.06 21:57:33 [Server] INFO at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:180) [spigot.jar:git-Spigot-1451]
    65. 19.06 21:57:33 [Server] INFO at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) [spigot.jar:git-Spigot-1451]
    66. 19.06 21:57:33 [Server] INFO at com.mcmnetwork.pda.PDA.onCommand(PDA.java:29) [questioncraft.jar:?]
    67. 19.06 21:57:33 [Server] INFO at com.mcmnetwork.pda.PDA.openPDA(PDA.java:48) ~[questioncraft.jar:?]
    68. 19.06 21:57:33 [Server] INFO at com.mcmnetwork.pda.PDA.getTokens(PDA.java:68) ~[questioncraft.jar:?]
    69. 19.06 21:57:33 [Server] INFO at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1388) ~[spigot.jar:git-Spigot-1451]
    70. 19.06 21:57:33 [Server] INFO at com.mysql.jdbc.StatementImpl.checkForDml(StatementImpl.java:434) ~[spigot.jar:git-Spigot-1451]
    71. 19.06 21:57:33 [Server] INFO at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927) ~[spigot.jar:git-Spigot-1451]
    72. 19.06 21:57:33 [Server] INFO at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982) ~[spigot.jar:git-Spigot-1451]
    73. 19.06 21:57:33 [Server] INFO at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987) ~[spigot.jar:git-Spigot-1451]
    74. 19.06 21:57:33 [Server] INFO at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073) ~[spigot.jar:git-Spigot-1451]
    75. 19.06 21:57:33 [Server] INFO java.sql.SQLException: Can not issue data manipulation statements with executeQuery().
    76. 19.06 21:57:33 [Server] INFO [21:57:33 ERROR]: null

    Sorry about the spigot, it is the only jar avalible to me at the time
    Please help! Ive been trying to fix all day
     
  2. Offline

    1Rogue

    What makes it more urgent than any other thread?

    You're using executeQuery() when you should be doing executeUpdate() (when you modify the table values).

    Spigot isn't supported here.
     
  3. Offline

    MCMatters

    1. Idk i just needed help
    2. Thanks ill try that
    3. I know.
     
  4. Offline

    1Rogue

    1. don't do it in the future, it's annoying
    3. Then you shouldn't be posting it here.
     
  5. Offline

    MCMatters

    19.06 22:08:23 [Server] INFO ... 13 more
    19.06 22:08:23 [Server] INFO at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot.jar:git-Spigot-1451]
    19.06 22:08:23 [Server] INFO at com.mcmnetwork.pda.PDA.onCommand(PDA.java:29) ~[?:?]
    19.06 22:08:23 [Server] INFO at com.mcmnetwork.pda.PDA.openPDA(PDA.java:48) ~[?:?]
    19.06 22:08:23 [Server] INFO at com.mcmnetwork.pda.PDA.getTokens(PDA.java:68) ~[?:?]
    19.06 22:08:23 [Server] INFO Type mismatch: cannot convert from int to ResultSet
    19.06 22:08:23 [Server] INFO Type mismatch: cannot convert from int to ResultSet
    19.06 22:08:23 [Server] INFO Caused by: java.lang.Error: Unresolved compilation problems:
    19.06 22:08:23 [Server] INFO at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628) [spigot.jar:git-Spigot-1451]
    19.06 22:08:23 [Server] INFO at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:482) [spigot.jar:git-Spigot-1451]
    19.06 22:08:23 [Server] INFO at net.minecraft.server.v1_7_R3.MinecraftServer.u(MinecraftServer.java:576) [spigot.jar:git-Spigot-1451]
    19.06 22:08:23 [Server] INFO at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:283) [spigot.jar:git-Spigot-1451]
    19.06 22:08:23 [Server] INFO at net.minecraft.server.v1_7_R3.MinecraftServer.v(MinecraftServer.java:713) [spigot.jar:git-Spigot-1451]
    19.06 22:08:23 [Server] INFO at net.minecraft.server.v1_7_R3.ServerConnection.c(ServerConnection.java:77) [spigot.jar:git-Spigot-1451]
    19.06 22:08:23 [Server] INFO at net.minecraft.server.v1_7_R3.NetworkManager.a(NetworkManager.java:176) [spigot.jar:git-Spigot-1451]
    19.06 22:08:23 [Server] INFO at net.minecraft.server.v1_7_R3.PacketPlayInChat.handle(PacketPlayInChat.java:65) [spigot.jar:git-Spigot-1451]
    19.06 22:08:23 [Server] INFO at net.minecraft.server.v1_7_R3.PacketPlayInChat.a(PacketPlayInChat.java:28) [spigot.jar:git-Spigot-1451]
    19.06 22:08:23 [Server] INFO at net.minecraft.server.v1_7_R3.PlayerConnection.a(PlayerConnection.java:830) [spigot.jar:git-Spigot-1451]
    19.06 22:08:23 [Server] INFO at net.minecraft.server.v1_7_R3.PlayerConnection.handleCommand(PlayerConnection.java:985) [spigot.jar:git-Spigot-1451]
    19.06 22:08:23 [Server] INFO at org.bukkit.craftbukkit.v1_7_R3.CraftServer.dispatchCommand(CraftServer.java:722) ~[spigot.jar:git-Spigot-1451]
    19.06 22:08:23 [Server] INFO at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:180) ~[spigot.jar:git-Spigot-1451]
    19.06 22:08:23 [Server] INFO at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[spigot.jar:git-Spigot-1451]
    19.06 22:08:23 [Server] INFO org.bukkit.command.CommandException: Unhandled exception executing command 'pda' in plugin Plugin v1.0
    BTW Code
    Code:java
    1. public int getTokens(String Player) throws SQLException {
    2. c = openConnection();
    3. Statement statement = c.createStatement();
    4. ResultSet res = statement.executeUpdate("CREATE TABLE IF NOT EXISTS `tokens` (`tokens` int(100000) NOT NULL AUTO_INCREMENT, `username` varchar(255) NOT NULL, PRIMARY KEY (`tokens`), UNIQUE KEY `username` (`username`)) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;");
    5. res.next();
    6. Statement statement2 = c.createStatement();
    7. ResultSet res2 = statement2.executeUpdate("SELECT * FROM tokens WHERE username = '" + Player + "';");
    8. res2.next();
    9. if(res2.getString("username") == null) {
    10. tokens = 0;
    11. } else {
    12. tokens = res.getInt("tokens");
    13. }
    14. return tokens;
    15. }
     
  6. Offline

    Iroh

    Locked.
    We do not support unofficial builds. (spigot)
     
Thread Status:
Not open for further replies.

Share This Page