Changeset: 562dbfb2fee8 for monetdb-java URL: http://dev.monetdb.org/hg/monetdb-java?cmd=changeset;node=562dbfb2fee8 Modified Files: ChangeLog src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java Branch: default Log Message:
Prevent null pointer exception by checking props argument Extended Changelog for changes made to setClientInfo() methods diffs (35 lines): diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -4,8 +4,11 @@ * Thu Nov 10 2016 Martin van Dinther <[email protected]> - Implemented Connection methods: getClientInfo(name) and getClientInfo(). They used to return null and empty Properties object. - Method Connection.setHoldability(ResultSet.CLOSE_CURSORS_AT_COMMIT) now - throws an SQLFeatureNotSupportedException. + Corrected implementation of Connection methods: setClientInfo(name, value) + and setClientInfo(properties). They are now processed as expected. + Corrected implementation of Connection.setHoldability(holdability). It now + throws an SQLFeatureNotSupportedException when holdability is not + ResultSet.HOLD_CURSORS_OVER_COMMIT (which is the only supported holdability). * Thu Oct 13 2016 Martin van Dinther <[email protected]> - Corrected implementation of java.sql.Wrapper methods isWrapperFor() diff --git a/src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java b/src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java --- a/src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java +++ b/src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java @@ -1448,9 +1448,11 @@ public class MonetConnection extends Mon */ @Override public void setClientInfo(Properties props) throws java.sql.SQLClientInfoException { - for (Entry<Object, Object> entry : props.entrySet()) { - setClientInfo(entry.getKey().toString(), - entry.getValue().toString()); + if (props != null) { + for (Entry<Object, Object> entry : props.entrySet()) { + setClientInfo(entry.getKey().toString(), + entry.getValue().toString()); + } } } _______________________________________________ checkin-list mailing list [email protected] https://www.monetdb.org/mailman/listinfo/checkin-list
