Specify returning of generated keys before using them

This is a herp derp fix
This commit is contained in:
Kane York 2013-06-30 20:23:34 -07:00 committed by T00thpick1
parent f5eb7a10de
commit f118ac14ca

View File

@ -302,7 +302,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
PreparedStatement statement = null;
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.setLong(2, System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR);
statement.execute();