Use try-with-resources language construct where feasible

Closes gh-2063

Co-authored-by: igor-suhorukov <igor.suhorukov@gmail.com>
This commit is contained in:
Sam Brannen
2020-06-16 22:57:45 +02:00
parent 456d2c46e3
commit 8099fc8178
23 changed files with 179 additions and 394 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -70,14 +70,10 @@ public abstract class AbstractLobCreatingPreparedStatementCallback implements Pr
@Override
public final Integer doInPreparedStatement(PreparedStatement ps) throws SQLException, DataAccessException {
LobCreator lobCreator = this.lobHandler.getLobCreator();
try {
try (LobCreator lobCreator = this.lobHandler.getLobCreator()) {
setValues(ps, lobCreator);
return ps.executeUpdate();
}
finally {
lobCreator.close();
}
}
/**