Closing statements after executing updates.
This commit is contained in:
parent
5cbff43379
commit
79bf52c312
|
@ -68,6 +68,8 @@ public class Table {
|
|||
rowSet.add(row);
|
||||
}
|
||||
|
||||
results.close();
|
||||
statement.close();
|
||||
connection.close();
|
||||
|
||||
return rowSet;
|
||||
|
@ -138,6 +140,9 @@ public class Table {
|
|||
Statement stm = connection.createStatement();
|
||||
|
||||
stm.executeUpdate(statement);
|
||||
|
||||
stm.close();
|
||||
connection.close();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -168,6 +173,9 @@ public class Table {
|
|||
Statement stm = connection.createStatement();
|
||||
|
||||
stm.executeUpdate(statement);
|
||||
|
||||
connection.close();
|
||||
stm.close();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -182,6 +190,9 @@ public class Table {
|
|||
Statement stm = connection.createStatement();
|
||||
|
||||
stm.executeUpdate(statement);
|
||||
|
||||
stm.close();
|
||||
connection.close();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -39,6 +39,7 @@ public class ItemDatabase {
|
|||
try {
|
||||
Statement statement = database.getConnection().createStatement();
|
||||
statement.executeUpdate("PRAGMA user_version = 1"); //We'll be able to change it later if we need to
|
||||
statement.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue