Description:
We have the following code in our app:
System.out.println(hstmt.toString()+" / " + hstmt.getConnection().getMetaData().getURL() + " / " + hstmt.getConnection().getClass().getName());
hstmt.executeUpdate( delsql.toString() );
From the debug string, we get the output:
com.mysql.jdbc.Statement@168a6fe / jdbc:mysql://192.168.10.117/quotedb?autoReconnect=true&maxReconnects=100 / com.m ysql.jdbc.Connection
But in executeUpdate, we get the following exception:
[java] java.sql.SQLException: General error, message from server: "Access denied for user: 'agguser@192.168.10.118' to database 'quotedb'"
[java] at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1651)
[java] at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:889)
[java] at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:956)
[java] at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:928)
[java] at com.mysql.jdbc.Connection.execSQL(Connection.java:1871)
[java] at com.mysql.jdbc.Connection.execSQL(Connection.java:1805)
[java] at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1231)
[java] at de.xtpro.quoteserver.Historizer.run(Historizer.java:201)
Note that access has been denied to a different IP than that which appears in the URL. Further debug output following the exception confirms that the URL hasn't changed. This statement is also only accessed from one Thread.
192.168.10.118 is localhost (though none of our code or config refers to it by this IP address), 192.168.10.117 is another machine.
How to repeat:
This bug is only repeatable for us when executing a delete statement, but we can consistently repeat it. The same Statement object has previously been succesfully used to execute insert statements.
Description: We have the following code in our app: System.out.println(hstmt.toString()+" / " + hstmt.getConnection().getMetaData().getURL() + " / " + hstmt.getConnection().getClass().getName()); hstmt.executeUpdate( delsql.toString() ); From the debug string, we get the output: com.mysql.jdbc.Statement@168a6fe / jdbc:mysql://192.168.10.117/quotedb?autoReconnect=true&maxReconnects=100 / com.m ysql.jdbc.Connection But in executeUpdate, we get the following exception: [java] java.sql.SQLException: General error, message from server: "Access denied for user: 'agguser@192.168.10.118' to database 'quotedb'" [java] at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1651) [java] at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:889) [java] at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:956) [java] at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:928) [java] at com.mysql.jdbc.Connection.execSQL(Connection.java:1871) [java] at com.mysql.jdbc.Connection.execSQL(Connection.java:1805) [java] at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1231) [java] at de.xtpro.quoteserver.Historizer.run(Historizer.java:201) Note that access has been denied to a different IP than that which appears in the URL. Further debug output following the exception confirms that the URL hasn't changed. This statement is also only accessed from one Thread. 192.168.10.118 is localhost (though none of our code or config refers to it by this IP address), 192.168.10.117 is another machine. How to repeat: This bug is only repeatable for us when executing a delete statement, but we can consistently repeat it. The same Statement object has previously been succesfully used to execute insert statements.