Skip to content

Commit

Permalink
RUtil: Use try-with-resources
Browse files Browse the repository at this point in the history
Signed-off-by: Tony Tkacik <tonydamage@gmail.com>
  • Loading branch information
tonydamage committed Jan 25, 2021
1 parent dcbafd9 commit 6320390
Showing 1 changed file with 1 addition and 7 deletions.
Expand Up @@ -451,14 +451,8 @@ public static String fixDBSchemaObjectNameLength(String input) {
}

public static void executeStatement(Connection connection, String sql) throws SQLException {
Statement stmt = null;
try {
stmt = connection.createStatement();
try (Statement stmt = connection.createStatement()) {
stmt.execute(sql);
} finally {
if (stmt != null && !stmt.isClosed()) {
stmt.close();
}
}
}
}

0 comments on commit 6320390

Please sign in to comment.