Mercurial > hg > monetdb-java
diff src/main/java/nl/cwi/monetdb/jdbc/MonetStatement.java @ 286:d430f8adbf1b
Add keyword "final" to those variables which do not change after first assigment.
In MonetConnection.java corrected size of array (was 7): isSet = new boolean[4];
In MonetPreparedStatement.java removed variable connection as it is already present in superclass MonetStatement (changed it into protected).
In MonetResultSet.java sinplified code for assigning Connection conn and DatabaseMetaData dbmd. It is now done on instantiation. This allows them to become "final".
author | Martin van Dinther <martin.van.dinther@monetdbsolutions.com> |
---|---|
date | Thu, 25 Jul 2019 19:04:10 +0200 (2019-07-25) |
parents | d4baf8a4b43a |
children | 2ad7f42f141d d477b3103a8b |
line wrap: on
line diff
--- a/src/main/java/nl/cwi/monetdb/jdbc/MonetStatement.java +++ b/src/main/java/nl/cwi/monetdb/jdbc/MonetStatement.java @@ -53,7 +53,7 @@ public class MonetStatement static final int DEF_MAXROWS = 0; /** The parental Connection object */ - private MonetConnection connection; + protected final MonetConnection connection; /** The last ResponseList object this Statement produced */ private MonetConnection.ResponseList lastResponseList; /** The last Response that this object uses */ @@ -522,7 +522,9 @@ public class MonetStatement /* do not catch SQLException here, as we want to know it when it fails */ finally { if (st != null) { - st.close(); + try { + st.close(); + } catch (SQLException e) { /* ignore */ } } } }