Use AutoCloseable gwtorm/jdbc instances

Bump the gwtorm version, since gwtorm changed Schema and
StatementExecutor to be AutoCloseable. This allows us to simplify many
callers.

While we're in there, fix some usages of more javax.sql classes like
Statement that became AutoCloseable in Java 7.

Change-Id: Icf86fdb52a499563ccf2a7c761cc498ad758d99c
This commit is contained in:
Dave Borowitz
2015-01-09 09:55:06 -08:00
parent 79d1083450
commit 9625637eb4
30 changed files with 332 additions and 526 deletions

View File

@@ -70,21 +70,11 @@ public class SchemaCreatorTest {
public void testGetCauses_CreateSchema() throws OrmException, SQLException,
IOException {
// Initially the schema should be empty.
//
{
final JdbcSchema d = (JdbcSchema) db.open();
try {
final String[] types = {"TABLE", "VIEW"};
final ResultSet rs =
d.getConnection().getMetaData().getTables(null, null, null, types);
try {
assertFalse(rs.next());
} finally {
rs.close();
}
} finally {
d.close();
}
String[] types = {"TABLE", "VIEW"};
try (JdbcSchema d = (JdbcSchema) db.open();
ResultSet rs = d.getConnection().getMetaData()
.getTables(null, null, null, types)) {
assertFalse(rs.next());
}
// Create the schema using the current schema version.