From: Simon Brandhof Date: Thu, 25 Aug 2016 14:28:33 +0000 (+0200) Subject: Allow try-with-resources with SqlStatement in DB migrations X-Git-Tag: 6.1-RC1~228 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=785e992028e545bb3a0811be7af7f4853b1137ff;p=sonarqube.git Allow try-with-resources with SqlStatement in DB migrations --- diff --git a/sonar-db/src/main/java/org/sonar/db/version/BaseSqlStatement.java b/sonar-db/src/main/java/org/sonar/db/version/BaseSqlStatement.java index 27e12563132..6b465a78952 100644 --- a/sonar-db/src/main/java/org/sonar/db/version/BaseSqlStatement.java +++ b/sonar-db/src/main/java/org/sonar/db/version/BaseSqlStatement.java @@ -35,10 +35,9 @@ class BaseSqlStatement implements SqlStatement { +public interface SqlStatement extends AutoCloseable { CHILD setBoolean(int columnIndex, @Nullable Boolean value) throws SQLException; CHILD setDate(int columnIndex, @Nullable Date value) throws SQLException; @@ -38,5 +38,6 @@ public interface SqlStatement { CHILD setBytes(int columnIndex, @Nullable byte[] data) throws SQLException; - CHILD close(); + @Override + void close(); }