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:
@@ -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.
|
||||
|
Reference in New Issue
Block a user