Closing statements after executing updates.

This commit is contained in:
Acrobot 2013-02-08 20:17:10 +01:00
parent 5cbff43379
commit 79bf52c312
2 changed files with 12 additions and 0 deletions

View File

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

View File

@ -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();
}