mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-30 00:56:47 +01:00
Specify returning of generated keys before using them
This is a herp derp fix
This commit is contained in:
parent
36b09421e8
commit
867ada6657
@ -302,7 +302,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
|
|||||||
PreparedStatement statement = null;
|
PreparedStatement statement = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
statement = connection.prepareStatement("INSERT INTO " + tablePrefix + "users (user, lastlogin) VALUES (?, ?)");
|
statement = connection.prepareStatement("INSERT INTO " + tablePrefix + "users (user, lastlogin) VALUES (?, ?)", Statement.RETURN_GENERATED_KEYS);
|
||||||
statement.setString(1, playerName);
|
statement.setString(1, playerName);
|
||||||
statement.setLong(2, System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR);
|
statement.setLong(2, System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR);
|
||||||
statement.execute();
|
statement.execute();
|
||||||
@ -1179,4 +1179,4 @@ public final class SQLDatabaseManager implements DatabaseManager {
|
|||||||
mcMMO.p.getLogger().severe("SQLState: " + ex.getSQLState());
|
mcMMO.p.getLogger().severe("SQLState: " + ex.getSQLState());
|
||||||
mcMMO.p.getLogger().severe("VendorError: " + ex.getErrorCode());
|
mcMMO.p.getLogger().severe("VendorError: " + ex.getErrorCode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user