Close the connection.

This commit is contained in:
Brianna 2020-04-15 11:03:53 -04:00
parent 5606ebd65f
commit f8a99302e8

View File

@ -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;
}
/**