mirror of
https://github.com/songoda/SongodaCore.git
synced 2024-11-30 14:03:23 +01:00
Close the connection.
This commit is contained in:
parent
5606ebd65f
commit
f8a99302e8
@ -48,14 +48,15 @@ public class DataManagerAbstract {
|
||||
query = table == null ? "SELECT LAST_INSERT_ID()" : select;
|
||||
}
|
||||
|
||||
int id = -1;
|
||||
try (Statement statement = connection.createStatement()) {
|
||||
ResultSet result = statement.executeQuery(query);
|
||||
result.next();
|
||||
return result.getInt(1);
|
||||
id = result.getInt(1);
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
return -1;
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user