You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by th...@apache.org on 2020/01/09 06:18:33 UTC

[commons-dbutils] annotated tag 1.8-RC2 created (now f8ca810)

This is an automated email from the ASF dual-hosted git repository.

thecarlhall pushed a change to annotated tag 1.8-RC2
in repository https://gitbox.apache.org/repos/asf/commons-dbutils.git.


      at f8ca810  (tag)
 tagging 3dc5efb853a4a64176664384d460e28f198c6101 (commit)
 replaces DBUTILS_1_8_RC1
      by Carl Hall
      on Wed Jan 8 22:18:24 2020 -0800

- Log -----------------------------------------------------------------
Tag commons dbutils release 1.8 RC2
-----BEGIN PGP SIGNATURE-----

iQJLBAABCgA1FiEE4y1PECLGFleRV/GxHlq208+Ov18FAl4WxbAXHHRoZWNhcmxo
YWxsQGFwYWNoZS5vcmcACgkQHlq208+Ov1+2gQ/8CztOjsssIRLn7eB5ktgTymBQ
ynvylYoRSR53xWO2VXwpSTnGtEHmuZztm2Ma1YyQht+sTqPp7OmvP91LPS0nUGXc
l7PkVKiow0WJOO7CfDo6Zg7I4lngag3O7w0fDTfJ9aG94+mv+BVyHpAvxQcm5dHm
D7UkbWSC44xhZogaIKePc11kz0+zfh6Kg5A/s2ZBc2L2qnI6zoVZTOSxdpHfvxPR
Dz1/TPOo/9lQbHwfvFlYc0M/WFSR6kETeBsO9h7hFrKr2MI/u6N8AkEXYhVl43fb
Nwt4XFuZg51VyliSPykOnC8WU1V20gcGzY5XiFiqK/3uVyVge2usV82u6J1/WVVf
t/x2Bw2KMULZM9l1DRJG2VyzKfMDRywUy0qu3Ia9sBciZg+cxk+QCLvdhhyqmtRO
i0DocKSguhzHtGoEi5SyGD1cqEH6rG8femZkXozkOb+9AyR6LS9sQob4G+LgVXEj
q8mXai3p9hDelA7F/zLkz/7/5Uot1fEafRhGQdDcUJFqgWxm7KiZcrIsfKsOxHf+
Yz2ybeec6/y1Y89QWkrVG3/iZJ0LxRG+kbK7LHmy/5GoBcnoPUiZTeMx3A/eDPVZ
CrLhUE0NdH28CaSsVuBkZvthIJw6AWmhdBzhTDXdBQBn9TNIAD1/jHU4wo4hLfga
68ePGkDzMNlEpgTbFsQ=
=b+pE
-----END PGP SIGNATURE-----
-----------------------------------------------------------------------

This annotated tag includes the following new commits:

     new c2c387c  Update release notes to accumulate starting with version 1.6
     new c156d3f  Revert javadoc because the methods wrap but don't inherit
     new f45b0e1  Bump RC version
     new 3dc5efb  DBUTILS-143 Use try-with-resources for all prepareConnection calls Remove closing of connection by private methods that are wrapped in convience methods

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[commons-dbutils] 03/04: Bump RC version

Posted by th...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

thecarlhall pushed a commit to annotated tag 1.8-RC2
in repository https://gitbox.apache.org/repos/asf/commons-dbutils.git

commit f45b0e161a1cd998e2dbf7a4f735d04319a3db61
Author: Carl Hall <th...@apache.org>
AuthorDate: Tue Jan 7 21:54:21 2020 -0800

    Bump RC version
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 074738a..287a748 100644
--- a/pom.xml
+++ b/pom.xml
@@ -253,7 +253,7 @@
     <commons.componentid>dbutils</commons.componentid>
     <commons.module.name>org.apache.commons.dbutils</commons.module.name>
     <commons.release.version>1.8</commons.release.version>
-    <commons.rc.version>RC1</commons.rc.version>
+    <commons.rc.version>RC2</commons.rc.version>
     <commons.bc.version>1.7</commons.bc.version>
     <commons.jira.id>DBUTILS</commons.jira.id>
     <commons.jira.pid>12310470</commons.jira.pid>


[commons-dbutils] 02/04: Revert javadoc because the methods wrap but don't inherit

Posted by th...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

thecarlhall pushed a commit to annotated tag 1.8-RC2
in repository https://gitbox.apache.org/repos/asf/commons-dbutils.git

commit c156d3f82730f0e4813275f7e96bf69a9baeb851
Author: Carl Hall <th...@apache.org>
AuthorDate: Tue Jan 7 21:32:19 2020 -0800

    Revert javadoc because the methods wrap but don't inherit
---
 .../commons/dbutils/BaseResultSetHandler.java      | 932 ++++++++++++++++-----
 1 file changed, 743 insertions(+), 189 deletions(-)

diff --git a/src/main/java/org/apache/commons/dbutils/BaseResultSetHandler.java b/src/main/java/org/apache/commons/dbutils/BaseResultSetHandler.java
index 1059bf6..814b52d 100644
--- a/src/main/java/org/apache/commons/dbutils/BaseResultSetHandler.java
+++ b/src/main/java/org/apache/commons/dbutils/BaseResultSetHandler.java
@@ -86,98 +86,129 @@ public abstract class BaseResultSetHandler<T> implements ResultSetHandler<T> {
     protected abstract T handle() throws SQLException;
 
     /**
-     * {@inheritDoc}
+     * @param row
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#absolute(int)
      */
     protected final boolean absolute(final int row) throws SQLException {
         return rs.absolute(row);
     }
 
     /**
-     * {@inheritDoc}
+     * @throws SQLException
+     * @see java.sql.ResultSet#afterLast()
      */
     protected final void afterLast() throws SQLException {
         rs.afterLast();
     }
 
     /**
-     * {@inheritDoc}
+     * @throws SQLException
+     * @see java.sql.ResultSet#beforeFirst()
      */
     protected final void beforeFirst() throws SQLException {
         rs.beforeFirst();
     }
 
     /**
-     * {@inheritDoc}
+     * @throws SQLException
+     * @see java.sql.ResultSet#cancelRowUpdates()
      */
     protected final void cancelRowUpdates() throws SQLException {
         rs.cancelRowUpdates();
     }
 
     /**
-     * {@inheritDoc}
+     * @throws SQLException
+     * @see java.sql.ResultSet#clearWarnings()
      */
     protected final void clearWarnings() throws SQLException {
         rs.clearWarnings();
     }
 
     /**
-     * {@inheritDoc}
+     * @throws SQLException
+     * @see java.sql.ResultSet#close()
      */
     protected final void close() throws SQLException {
         rs.close();
     }
 
     /**
-     * {@inheritDoc}
+     * @throws SQLException
+     * @see java.sql.ResultSet#deleteRow()
      */
     protected final void deleteRow() throws SQLException {
         rs.deleteRow();
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#findColumn(java.lang.String)
      */
     protected final int findColumn(final String columnLabel) throws SQLException {
         return rs.findColumn(columnLabel);
     }
 
     /**
-     * {@inheritDoc}
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#first()
      */
     protected final boolean first() throws SQLException {
         return rs.first();
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getArray(int)
      */
     protected final Array getArray(final int columnIndex) throws SQLException {
         return rs.getArray(columnIndex);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getArray(java.lang.String)
      */
     protected final Array getArray(final String columnLabel) throws SQLException {
         return rs.getArray(columnLabel);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getAsciiStream(int)
      */
     protected final InputStream getAsciiStream(final int columnIndex) throws SQLException {
         return rs.getAsciiStream(columnIndex);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getAsciiStream(java.lang.String)
      */
     protected final InputStream getAsciiStream(final String columnLabel) throws SQLException {
         return rs.getAsciiStream(columnLabel);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param scale
+     * @return
+     * @throws SQLException
+     * @deprecated
+     * @see java.sql.ResultSet#getBigDecimal(int, int)
      */
     @Deprecated
     protected final BigDecimal getBigDecimal(final int columnIndex, final int scale) throws SQLException {
@@ -185,14 +216,22 @@ public abstract class BaseResultSetHandler<T> implements ResultSetHandler<T> {
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getBigDecimal(int)
      */
     protected final BigDecimal getBigDecimal(final int columnIndex) throws SQLException {
         return rs.getBigDecimal(columnIndex);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param scale
+     * @return
+     * @throws SQLException
+     * @deprecated
+     * @see java.sql.ResultSet#getBigDecimal(java.lang.String, int)
      */
     @Deprecated
     protected final BigDecimal getBigDecimal(final String columnLabel, final int scale) throws SQLException {
@@ -200,469 +239,670 @@ public abstract class BaseResultSetHandler<T> implements ResultSetHandler<T> {
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getBigDecimal(java.lang.String)
      */
     protected final BigDecimal getBigDecimal(final String columnLabel) throws SQLException {
         return rs.getBigDecimal(columnLabel);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getBinaryStream(int)
      */
     protected final InputStream getBinaryStream(final int columnIndex) throws SQLException {
         return rs.getBinaryStream(columnIndex);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getBinaryStream(java.lang.String)
      */
     protected final InputStream getBinaryStream(final String columnLabel) throws SQLException {
         return rs.getBinaryStream(columnLabel);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getBlob(int)
      */
     protected final Blob getBlob(final int columnIndex) throws SQLException {
         return rs.getBlob(columnIndex);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getBlob(java.lang.String)
      */
     protected final Blob getBlob(final String columnLabel) throws SQLException {
         return rs.getBlob(columnLabel);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getBoolean(int)
      */
     protected final boolean getBoolean(final int columnIndex) throws SQLException {
         return rs.getBoolean(columnIndex);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getBoolean(java.lang.String)
      */
     protected final boolean getBoolean(final String columnLabel) throws SQLException {
         return rs.getBoolean(columnLabel);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getByte(int)
      */
     protected final byte getByte(final int columnIndex) throws SQLException {
         return rs.getByte(columnIndex);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getByte(java.lang.String)
      */
     protected final byte getByte(final String columnLabel) throws SQLException {
         return rs.getByte(columnLabel);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getBytes(int)
      */
     protected final byte[] getBytes(final int columnIndex) throws SQLException {
         return rs.getBytes(columnIndex);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getBytes(java.lang.String)
      */
     protected final byte[] getBytes(final String columnLabel) throws SQLException {
         return rs.getBytes(columnLabel);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getCharacterStream(int)
      */
     protected final Reader getCharacterStream(final int columnIndex) throws SQLException {
         return rs.getCharacterStream(columnIndex);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getCharacterStream(java.lang.String)
      */
     protected final Reader getCharacterStream(final String columnLabel) throws SQLException {
         return rs.getCharacterStream(columnLabel);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getClob(int)
      */
     protected final Clob getClob(final int columnIndex) throws SQLException {
         return rs.getClob(columnIndex);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getClob(java.lang.String)
      */
     protected final Clob getClob(final String columnLabel) throws SQLException {
         return rs.getClob(columnLabel);
     }
 
     /**
-     * {@inheritDoc}
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getConcurrency()
      */
     protected final int getConcurrency() throws SQLException {
         return rs.getConcurrency();
     }
 
     /**
-     * {@inheritDoc}
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getCursorName()
      */
     protected final String getCursorName() throws SQLException {
         return rs.getCursorName();
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param cal
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getDate(int, java.util.Calendar)
      */
     protected final Date getDate(final int columnIndex, final Calendar cal) throws SQLException {
         return rs.getDate(columnIndex, cal);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getDate(int)
      */
     protected final Date getDate(final int columnIndex) throws SQLException {
         return rs.getDate(columnIndex);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param cal
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getDate(java.lang.String, java.util.Calendar)
      */
     protected final Date getDate(final String columnLabel, final Calendar cal) throws SQLException {
         return rs.getDate(columnLabel, cal);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getDate(java.lang.String)
      */
     protected final Date getDate(final String columnLabel) throws SQLException {
         return rs.getDate(columnLabel);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getDouble(int)
      */
     protected final double getDouble(final int columnIndex) throws SQLException {
         return rs.getDouble(columnIndex);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getDouble(java.lang.String)
      */
     protected final double getDouble(final String columnLabel) throws SQLException {
         return rs.getDouble(columnLabel);
     }
 
     /**
-     * {@inheritDoc}
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getFetchDirection()
      */
     protected final int getFetchDirection() throws SQLException {
         return rs.getFetchDirection();
     }
 
     /**
-     * {@inheritDoc}
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getFetchSize()
      */
     protected final int getFetchSize() throws SQLException {
         return rs.getFetchSize();
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getFloat(int)
      */
     protected final float getFloat(final int columnIndex) throws SQLException {
         return rs.getFloat(columnIndex);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getFloat(java.lang.String)
      */
     protected final float getFloat(final String columnLabel) throws SQLException {
         return rs.getFloat(columnLabel);
     }
 
     /**
-     * {@inheritDoc}
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getHoldability()
      */
     protected final int getHoldability() throws SQLException {
         return rs.getHoldability();
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getInt(int)
      */
     protected final int getInt(final int columnIndex) throws SQLException {
         return rs.getInt(columnIndex);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getInt(java.lang.String)
      */
     protected final int getInt(final String columnLabel) throws SQLException {
         return rs.getInt(columnLabel);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getLong(int)
      */
     protected final long getLong(final int columnIndex) throws SQLException {
         return rs.getLong(columnIndex);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getLong(java.lang.String)
      */
     protected final long getLong(final String columnLabel) throws SQLException {
         return rs.getLong(columnLabel);
     }
 
     /**
-     * {@inheritDoc}
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getMetaData()
      */
     protected final ResultSetMetaData getMetaData() throws SQLException {
         return rs.getMetaData();
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getNCharacterStream(int)
      */
     protected final Reader getNCharacterStream(final int columnIndex) throws SQLException {
         return rs.getNCharacterStream(columnIndex);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getNCharacterStream(java.lang.String)
      */
     protected final Reader getNCharacterStream(final String columnLabel) throws SQLException {
         return rs.getNCharacterStream(columnLabel);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getNClob(int)
      */
     protected final NClob getNClob(final int columnIndex) throws SQLException {
         return rs.getNClob(columnIndex);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getNClob(java.lang.String)
      */
     protected final NClob getNClob(final String columnLabel) throws SQLException {
         return rs.getNClob(columnLabel);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getNString(int)
      */
     protected final String getNString(final int columnIndex) throws SQLException {
         return rs.getNString(columnIndex);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getNString(java.lang.String)
      */
     protected final String getNString(final String columnLabel) throws SQLException {
         return rs.getNString(columnLabel);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param map
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getObject(int, java.util.Map)
      */
     protected final Object getObject(final int columnIndex, final Map<String, Class<?>> map) throws SQLException {
         return rs.getObject(columnIndex, map);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getObject(int)
      */
     protected final Object getObject(final int columnIndex) throws SQLException {
         return rs.getObject(columnIndex);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param map
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getObject(java.lang.String, java.util.Map)
      */
     protected final Object getObject(final String columnLabel, final Map<String, Class<?>> map) throws SQLException {
         return rs.getObject(columnLabel, map);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getObject(java.lang.String)
      */
     protected final Object getObject(final String columnLabel) throws SQLException {
         return rs.getObject(columnLabel);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getRef(int)
      */
     protected final Ref getRef(final int columnIndex) throws SQLException {
         return rs.getRef(columnIndex);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getRef(java.lang.String)
      */
     protected final Ref getRef(final String columnLabel) throws SQLException {
         return rs.getRef(columnLabel);
     }
 
     /**
-     * {@inheritDoc}
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getRow()
      */
     protected final int getRow() throws SQLException {
         return rs.getRow();
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getRowId(int)
      */
     protected final RowId getRowId(final int columnIndex) throws SQLException {
         return rs.getRowId(columnIndex);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getRowId(java.lang.String)
      */
     protected final RowId getRowId(final String columnLabel) throws SQLException {
         return rs.getRowId(columnLabel);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getSQLXML(int)
      */
     protected final SQLXML getSQLXML(final int columnIndex) throws SQLException {
         return rs.getSQLXML(columnIndex);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getSQLXML(java.lang.String)
      */
     protected final SQLXML getSQLXML(final String columnLabel) throws SQLException {
         return rs.getSQLXML(columnLabel);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getShort(int)
      */
     protected final short getShort(final int columnIndex) throws SQLException {
         return rs.getShort(columnIndex);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getShort(java.lang.String)
      */
     protected final short getShort(final String columnLabel) throws SQLException {
         return rs.getShort(columnLabel);
     }
 
     /**
-     * {@inheritDoc}
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getStatement()
      */
     protected final Statement getStatement() throws SQLException {
         return rs.getStatement();
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getString(int)
      */
     protected final String getString(final int columnIndex) throws SQLException {
         return rs.getString(columnIndex);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getString(java.lang.String)
      */
     protected final String getString(final String columnLabel) throws SQLException {
         return rs.getString(columnLabel);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param cal
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getTime(int, java.util.Calendar)
      */
     protected final Time getTime(final int columnIndex, final Calendar cal) throws SQLException {
         return rs.getTime(columnIndex, cal);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getTime(int)
      */
     protected final Time getTime(final int columnIndex) throws SQLException {
         return rs.getTime(columnIndex);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param cal
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getTime(java.lang.String, java.util.Calendar)
      */
     protected final Time getTime(final String columnLabel, final Calendar cal) throws SQLException {
         return rs.getTime(columnLabel, cal);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getTime(java.lang.String)
      */
     protected final Time getTime(final String columnLabel) throws SQLException {
         return rs.getTime(columnLabel);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param cal
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getTimestamp(int, java.util.Calendar)
      */
     protected final Timestamp getTimestamp(final int columnIndex, final Calendar cal) throws SQLException {
         return rs.getTimestamp(columnIndex, cal);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getTimestamp(int)
      */
     protected final Timestamp getTimestamp(final int columnIndex) throws SQLException {
         return rs.getTimestamp(columnIndex);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param cal
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getTimestamp(java.lang.String, java.util.Calendar)
      */
     protected final Timestamp getTimestamp(final String columnLabel, final Calendar cal) throws SQLException {
         return rs.getTimestamp(columnLabel, cal);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getTimestamp(java.lang.String)
      */
     protected final Timestamp getTimestamp(final String columnLabel) throws SQLException {
         return rs.getTimestamp(columnLabel);
     }
 
     /**
-     * {@inheritDoc}
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getType()
      */
     protected final int getType() throws SQLException {
         return rs.getType();
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getURL(int)
      */
     protected final URL getURL(final int columnIndex) throws SQLException {
         return rs.getURL(columnIndex);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getURL(java.lang.String)
      */
     protected final URL getURL(final String columnLabel) throws SQLException {
         return rs.getURL(columnLabel);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @return
+     * @throws SQLException
+     * @deprecated
+     * @see java.sql.ResultSet#getUnicodeStream(int)
      */
     @Deprecated
     protected final InputStream getUnicodeStream(final int columnIndex) throws SQLException {
@@ -670,7 +910,11 @@ public abstract class BaseResultSetHandler<T> implements ResultSetHandler<T> {
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @return
+     * @throws SQLException
+     * @deprecated
+     * @see java.sql.ResultSet#getUnicodeStream(java.lang.String)
      */
     @Deprecated
     protected final InputStream getUnicodeStream(final String columnLabel) throws SQLException {
@@ -678,735 +922,1045 @@ public abstract class BaseResultSetHandler<T> implements ResultSetHandler<T> {
     }
 
     /**
-     * {@inheritDoc}
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#getWarnings()
      */
     protected final SQLWarning getWarnings() throws SQLException {
         return rs.getWarnings();
     }
 
     /**
-     * {@inheritDoc}
+     * @throws SQLException
+     * @see java.sql.ResultSet#insertRow()
      */
     protected final void insertRow() throws SQLException {
         rs.insertRow();
     }
 
     /**
-     * {@inheritDoc}
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#isAfterLast()
      */
     protected final boolean isAfterLast() throws SQLException {
         return rs.isAfterLast();
     }
 
     /**
-     * {@inheritDoc}
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#isBeforeFirst()
      */
     protected final boolean isBeforeFirst() throws SQLException {
         return rs.isBeforeFirst();
     }
 
     /**
-     * {@inheritDoc}
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#isClosed()
      */
     protected final boolean isClosed() throws SQLException {
         return rs.isClosed();
     }
 
     /**
-     * {@inheritDoc}
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#isFirst()
      */
     protected final boolean isFirst() throws SQLException {
         return rs.isFirst();
     }
 
     /**
-     * {@inheritDoc}
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#isLast()
      */
     protected final boolean isLast() throws SQLException {
         return rs.isLast();
     }
 
     /**
-     * {@inheritDoc}
+     * @param iface
+     * @return
+     * @throws SQLException
+     * @see java.sql.Wrapper#isWrapperFor(java.lang.Class)
      */
     protected final boolean isWrapperFor(final Class<?> iface) throws SQLException {
         return rs.isWrapperFor(iface);
     }
 
     /**
-     * {@inheritDoc}
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#last()
      */
     protected final boolean last() throws SQLException {
         return rs.last();
     }
 
     /**
-     * {@inheritDoc}
+     * @throws SQLException
+     * @see java.sql.ResultSet#moveToCurrentRow()
      */
     protected final void moveToCurrentRow() throws SQLException {
         rs.moveToCurrentRow();
     }
 
     /**
-     * {@inheritDoc}
+     * @throws SQLException
+     * @see java.sql.ResultSet#moveToInsertRow()
      */
     protected final void moveToInsertRow() throws SQLException {
         rs.moveToInsertRow();
     }
 
     /**
-     * {@inheritDoc}
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#next()
      */
     protected final boolean next() throws SQLException {
         return rs.next();
     }
 
     /**
-     * {@inheritDoc}
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#previous()
      */
     protected final boolean previous() throws SQLException {
         return rs.previous();
     }
 
     /**
-     * {@inheritDoc}
+     * @throws SQLException
+     * @see java.sql.ResultSet#refreshRow()
      */
     protected final void refreshRow() throws SQLException {
         rs.refreshRow();
     }
 
     /**
-     * {@inheritDoc}
+     * @param rows
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#relative(int)
      */
     protected final boolean relative(final int rows) throws SQLException {
         return rs.relative(rows);
     }
 
     /**
-     * {@inheritDoc}
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#rowDeleted()
      */
     protected final boolean rowDeleted() throws SQLException {
         return rs.rowDeleted();
     }
 
     /**
-     * {@inheritDoc}
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#rowInserted()
      */
     protected final boolean rowInserted() throws SQLException {
         return rs.rowInserted();
     }
 
     /**
-     * {@inheritDoc}
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#rowUpdated()
      */
     protected final boolean rowUpdated() throws SQLException {
         return rs.rowUpdated();
     }
 
     /**
-     * {@inheritDoc}
+     * @param direction
+     * @throws SQLException
+     * @see java.sql.ResultSet#setFetchDirection(int)
      */
     protected final void setFetchDirection(final int direction) throws SQLException {
         rs.setFetchDirection(direction);
     }
 
     /**
-     * {@inheritDoc}
+     * @param rows
+     * @throws SQLException
+     * @see java.sql.ResultSet#setFetchSize(int)
      */
     protected final void setFetchSize(final int rows) throws SQLException {
         rs.setFetchSize(rows);
     }
 
     /**
-     * {@inheritDoc}
+     * @param iface
+     * @return
+     * @throws SQLException
+     * @see java.sql.Wrapper#unwrap(java.lang.Class)
      */
     protected final <E> E unwrap(final Class<E> iface) throws SQLException {
         return rs.unwrap(iface);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateArray(int, java.sql.Array)
      */
     protected final void updateArray(final int columnIndex, final Array x) throws SQLException {
         rs.updateArray(columnIndex, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateArray(java.lang.String, java.sql.Array)
      */
     protected final void updateArray(final String columnLabel, final Array x) throws SQLException {
         rs.updateArray(columnLabel, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @param length
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateAsciiStream(int, java.io.InputStream, int)
      */
     protected final void updateAsciiStream(final int columnIndex, final InputStream x, final int length) throws SQLException {
         rs.updateAsciiStream(columnIndex, x, length);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @param length
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateAsciiStream(int, java.io.InputStream, long)
      */
     protected final void updateAsciiStream(final int columnIndex, final InputStream x, final long length) throws SQLException {
         rs.updateAsciiStream(columnIndex, x, length);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateAsciiStream(int, java.io.InputStream)
      */
     protected final void updateAsciiStream(final int columnIndex, final InputStream x) throws SQLException {
         rs.updateAsciiStream(columnIndex, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param x
+     * @param length
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateAsciiStream(java.lang.String, java.io.InputStream, int)
      */
     protected final void updateAsciiStream(final String columnLabel, final InputStream x, final int length) throws SQLException {
         rs.updateAsciiStream(columnLabel, x, length);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param x
+     * @param length
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateAsciiStream(java.lang.String, java.io.InputStream, long)
      */
     protected final void updateAsciiStream(final String columnLabel, final InputStream x, final long length) throws SQLException {
         rs.updateAsciiStream(columnLabel, x, length);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateAsciiStream(java.lang.String, java.io.InputStream)
      */
     protected final void updateAsciiStream(final String columnLabel, final InputStream x) throws SQLException {
         rs.updateAsciiStream(columnLabel, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateBigDecimal(int, java.math.BigDecimal)
      */
     protected final void updateBigDecimal(final int columnIndex, final BigDecimal x) throws SQLException {
         rs.updateBigDecimal(columnIndex, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateBigDecimal(java.lang.String, java.math.BigDecimal)
      */
     protected final void updateBigDecimal(final String columnLabel, final BigDecimal x) throws SQLException {
         rs.updateBigDecimal(columnLabel, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @param length
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateBinaryStream(int, java.io.InputStream, int)
      */
     protected final void updateBinaryStream(final int columnIndex, final InputStream x, final int length) throws SQLException {
         rs.updateBinaryStream(columnIndex, x, length);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @param length
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateBinaryStream(int, java.io.InputStream, long)
      */
     protected final void updateBinaryStream(final int columnIndex, final InputStream x, final long length) throws SQLException {
         rs.updateBinaryStream(columnIndex, x, length);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateBinaryStream(int, java.io.InputStream)
      */
     protected final void updateBinaryStream(final int columnIndex, final InputStream x) throws SQLException {
         rs.updateBinaryStream(columnIndex, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param x
+     * @param length
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateBinaryStream(java.lang.String, java.io.InputStream, int)
      */
     protected final void updateBinaryStream(final String columnLabel, final InputStream x, final int length) throws SQLException {
         rs.updateBinaryStream(columnLabel, x, length);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param x
+     * @param length
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateBinaryStream(java.lang.String, java.io.InputStream, long)
      */
     protected final void updateBinaryStream(final String columnLabel, final InputStream x, final long length) throws SQLException {
         rs.updateBinaryStream(columnLabel, x, length);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateBinaryStream(java.lang.String, java.io.InputStream)
      */
     protected final void updateBinaryStream(final String columnLabel, final InputStream x) throws SQLException {
         rs.updateBinaryStream(columnLabel, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateBlob(int, java.sql.Blob)
      */
     protected final void updateBlob(final int columnIndex, final Blob x) throws SQLException {
         rs.updateBlob(columnIndex, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param inputStream
+     * @param length
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateBlob(int, java.io.InputStream, long)
      */
     protected final void updateBlob(final int columnIndex, final InputStream inputStream, final long length) throws SQLException {
         rs.updateBlob(columnIndex, inputStream, length);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param inputStream
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateBlob(int, java.io.InputStream)
      */
     protected final void updateBlob(final int columnIndex, final InputStream inputStream) throws SQLException {
         rs.updateBlob(columnIndex, inputStream);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateBlob(java.lang.String, java.sql.Blob)
      */
     protected final void updateBlob(final String columnLabel, final Blob x) throws SQLException {
         rs.updateBlob(columnLabel, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param inputStream
+     * @param length
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateBlob(java.lang.String, java.io.InputStream, long)
      */
     protected final void updateBlob(final String columnLabel, final InputStream inputStream, final long length) throws SQLException {
         rs.updateBlob(columnLabel, inputStream, length);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param inputStream
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateBlob(java.lang.String, java.io.InputStream)
      */
     protected final void updateBlob(final String columnLabel, final InputStream inputStream) throws SQLException {
         rs.updateBlob(columnLabel, inputStream);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateBoolean(int, boolean)
      */
     protected final void updateBoolean(final int columnIndex, final boolean x) throws SQLException {
         rs.updateBoolean(columnIndex, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateBoolean(java.lang.String, boolean)
      */
     protected final void updateBoolean(final String columnLabel, final boolean x) throws SQLException {
         rs.updateBoolean(columnLabel, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateByte(int, byte)
      */
     protected final void updateByte(final int columnIndex, final byte x) throws SQLException {
         rs.updateByte(columnIndex, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateByte(java.lang.String, byte)
      */
     protected final void updateByte(final String columnLabel, final byte x) throws SQLException {
         rs.updateByte(columnLabel, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateBytes(int, byte[])
      */
     protected final void updateBytes(final int columnIndex, final byte[] x) throws SQLException {
         rs.updateBytes(columnIndex, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateBytes(java.lang.String, byte[])
      */
     protected final void updateBytes(final String columnLabel, final byte[] x) throws SQLException {
         rs.updateBytes(columnLabel, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @param length
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateCharacterStream(int, java.io.Reader, int)
      */
     protected final void updateCharacterStream(final int columnIndex, final Reader x, final int length) throws SQLException {
         rs.updateCharacterStream(columnIndex, x, length);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @param length
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateCharacterStream(int, java.io.Reader, long)
      */
     protected final void updateCharacterStream(final int columnIndex, final Reader x, final long length) throws SQLException {
         rs.updateCharacterStream(columnIndex, x, length);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateCharacterStream(int, java.io.Reader)
      */
     protected final void updateCharacterStream(final int columnIndex, final Reader x) throws SQLException {
         rs.updateCharacterStream(columnIndex, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param reader
+     * @param length
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateCharacterStream(java.lang.String, java.io.Reader, int)
      */
     protected final void updateCharacterStream(final String columnLabel, final Reader reader, final int length) throws SQLException {
         rs.updateCharacterStream(columnLabel, reader, length);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param reader
+     * @param length
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateCharacterStream(java.lang.String, java.io.Reader, long)
      */
     protected final void updateCharacterStream(final String columnLabel, final Reader reader, final long length) throws SQLException {
         rs.updateCharacterStream(columnLabel, reader, length);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param reader
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateCharacterStream(java.lang.String, java.io.Reader)
      */
     protected final void updateCharacterStream(final String columnLabel, final Reader reader) throws SQLException {
         rs.updateCharacterStream(columnLabel, reader);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateClob(int, java.sql.Clob)
      */
     protected final void updateClob(final int columnIndex, final Clob x) throws SQLException {
         rs.updateClob(columnIndex, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param reader
+     * @param length
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateClob(int, java.io.Reader, long)
      */
     protected final void updateClob(final int columnIndex, final Reader reader, final long length) throws SQLException {
         rs.updateClob(columnIndex, reader, length);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param reader
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateClob(int, java.io.Reader)
      */
     protected final void updateClob(final int columnIndex, final Reader reader) throws SQLException {
         rs.updateClob(columnIndex, reader);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateClob(java.lang.String, java.sql.Clob)
      */
     protected final void updateClob(final String columnLabel, final Clob x) throws SQLException {
         rs.updateClob(columnLabel, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param reader
+     * @param length
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateClob(java.lang.String, java.io.Reader, long)
      */
     protected final void updateClob(final String columnLabel, final Reader reader, final long length) throws SQLException {
         rs.updateClob(columnLabel, reader, length);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param reader
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateClob(java.lang.String, java.io.Reader)
      */
     protected final void updateClob(final String columnLabel, final Reader reader) throws SQLException {
         rs.updateClob(columnLabel, reader);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateDate(int, java.sql.Date)
      */
     protected final void updateDate(final int columnIndex, final Date x) throws SQLException {
         rs.updateDate(columnIndex, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateDate(java.lang.String, java.sql.Date)
      */
     protected final void updateDate(final String columnLabel, final Date x) throws SQLException {
         rs.updateDate(columnLabel, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateDouble(int, double)
      */
     protected final void updateDouble(final int columnIndex, final double x) throws SQLException {
         rs.updateDouble(columnIndex, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateDouble(java.lang.String, double)
      */
     protected final void updateDouble(final String columnLabel, final double x) throws SQLException {
         rs.updateDouble(columnLabel, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateFloat(int, float)
      */
     protected final void updateFloat(final int columnIndex, final float x) throws SQLException {
         rs.updateFloat(columnIndex, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateFloat(java.lang.String, float)
      */
     protected final void updateFloat(final String columnLabel, final float x) throws SQLException {
         rs.updateFloat(columnLabel, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateInt(int, int)
      */
     protected final void updateInt(final int columnIndex, final int x) throws SQLException {
         rs.updateInt(columnIndex, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateInt(java.lang.String, int)
      */
     protected final void updateInt(final String columnLabel, final int x) throws SQLException {
         rs.updateInt(columnLabel, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateLong(int, long)
      */
     protected final void updateLong(final int columnIndex, final long x) throws SQLException {
         rs.updateLong(columnIndex, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateLong(java.lang.String, long)
      */
     protected final void updateLong(final String columnLabel, final long x) throws SQLException {
         rs.updateLong(columnLabel, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @param length
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateNCharacterStream(int, java.io.Reader, long)
      */
     protected final void updateNCharacterStream(final int columnIndex, final Reader x, final long length) throws SQLException {
         rs.updateNCharacterStream(columnIndex, x, length);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateNCharacterStream(int, java.io.Reader)
      */
     protected final void updateNCharacterStream(final int columnIndex, final Reader x) throws SQLException {
         rs.updateNCharacterStream(columnIndex, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param reader
+     * @param length
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateNCharacterStream(java.lang.String, java.io.Reader, long)
      */
     protected final void updateNCharacterStream(final String columnLabel, final Reader reader, final long length) throws SQLException {
         rs.updateNCharacterStream(columnLabel, reader, length);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param reader
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateNCharacterStream(java.lang.String, java.io.Reader)
      */
     protected final void updateNCharacterStream(final String columnLabel, final Reader reader) throws SQLException {
         rs.updateNCharacterStream(columnLabel, reader);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param nClob
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateNClob(int, java.sql.NClob)
      */
     protected final void updateNClob(final int columnIndex, final NClob nClob) throws SQLException {
         rs.updateNClob(columnIndex, nClob);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param reader
+     * @param length
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateNClob(int, java.io.Reader, long)
      */
     protected final void updateNClob(final int columnIndex, final Reader reader, final long length) throws SQLException {
         rs.updateNClob(columnIndex, reader, length);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param reader
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateNClob(int, java.io.Reader)
      */
     protected final void updateNClob(final int columnIndex, final Reader reader) throws SQLException {
         rs.updateNClob(columnIndex, reader);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param nClob
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateNClob(java.lang.String, java.sql.NClob)
      */
     protected final void updateNClob(final String columnLabel, final NClob nClob) throws SQLException {
         rs.updateNClob(columnLabel, nClob);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param reader
+     * @param length
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateNClob(java.lang.String, java.io.Reader, long)
      */
     protected final void updateNClob(final String columnLabel, final Reader reader, final long length) throws SQLException {
         rs.updateNClob(columnLabel, reader, length);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param reader
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateNClob(java.lang.String, java.io.Reader)
      */
     protected final void updateNClob(final String columnLabel, final Reader reader) throws SQLException {
         rs.updateNClob(columnLabel, reader);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param nString
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateNString(int, java.lang.String)
      */
     protected final void updateNString(final int columnIndex, final String nString) throws SQLException {
         rs.updateNString(columnIndex, nString);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param nString
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateNString(java.lang.String, java.lang.String)
      */
     protected final void updateNString(final String columnLabel, final String nString) throws SQLException {
         rs.updateNString(columnLabel, nString);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateNull(int)
      */
     protected final void updateNull(final int columnIndex) throws SQLException {
         rs.updateNull(columnIndex);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateNull(java.lang.String)
      */
     protected final void updateNull(final String columnLabel) throws SQLException {
         rs.updateNull(columnLabel);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @param scaleOrLength
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateObject(int, java.lang.Object, int)
      */
     protected final void updateObject(final int columnIndex, final Object x, final int scaleOrLength) throws SQLException {
         rs.updateObject(columnIndex, x, scaleOrLength);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateObject(int, java.lang.Object)
      */
     protected final void updateObject(final int columnIndex, final Object x) throws SQLException {
         rs.updateObject(columnIndex, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param x
+     * @param scaleOrLength
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateObject(java.lang.String, java.lang.Object, int)
      */
     protected final void updateObject(final String columnLabel, final Object x, final int scaleOrLength) throws SQLException {
         rs.updateObject(columnLabel, x, scaleOrLength);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateObject(java.lang.String, java.lang.Object)
      */
     protected final void updateObject(final String columnLabel, final Object x) throws SQLException {
         rs.updateObject(columnLabel, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateRef(int, java.sql.Ref)
      */
     protected final void updateRef(final int columnIndex, final Ref x) throws SQLException {
         rs.updateRef(columnIndex, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateRef(java.lang.String, java.sql.Ref)
      */
     protected final void updateRef(final String columnLabel, final Ref x) throws SQLException {
         rs.updateRef(columnLabel, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateRow()
      */
     protected final void updateRow() throws SQLException {
         rs.updateRow();
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateRowId(int, java.sql.RowId)
      */
     protected final void updateRowId(final int columnIndex, final RowId x) throws SQLException {
         rs.updateRowId(columnIndex, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateRowId(java.lang.String, java.sql.RowId)
      */
     protected final void updateRowId(final String columnLabel, final RowId x) throws SQLException {
         rs.updateRowId(columnLabel, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param xmlObject
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateSQLXML(int, java.sql.SQLXML)
      */
     protected final void updateSQLXML(final int columnIndex, final SQLXML xmlObject) throws SQLException {
         rs.updateSQLXML(columnIndex, xmlObject);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param xmlObject
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateSQLXML(java.lang.String, java.sql.SQLXML)
      */
     protected final void updateSQLXML(final String columnLabel, final SQLXML xmlObject) throws SQLException {
         rs.updateSQLXML(columnLabel, xmlObject);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateShort(int, short)
      */
     protected final void updateShort(final int columnIndex, final short x) throws SQLException {
         rs.updateShort(columnIndex, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateShort(java.lang.String, short)
      */
     protected final void updateShort(final String columnLabel, final short x) throws SQLException {
         rs.updateShort(columnLabel, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateString(int, java.lang.String)
      */
     protected final void updateString(final int columnIndex, final String x) throws SQLException {
         rs.updateString(columnIndex, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateString(java.lang.String, java.lang.String)
      */
     protected final void updateString(final String columnLabel, final String x) throws SQLException {
         rs.updateString(columnLabel, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateTime(int, java.sql.Time)
      */
     protected final void updateTime(final int columnIndex, final Time x) throws SQLException {
         rs.updateTime(columnIndex, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateTime(java.lang.String, java.sql.Time)
      */
     protected final void updateTime(final String columnLabel, final Time x) throws SQLException {
         rs.updateTime(columnLabel, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnIndex
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateTimestamp(int, java.sql.Timestamp)
      */
     protected final void updateTimestamp(final int columnIndex, final Timestamp x) throws SQLException {
         rs.updateTimestamp(columnIndex, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @param columnLabel
+     * @param x
+     * @throws SQLException
+     * @see java.sql.ResultSet#updateTimestamp(java.lang.String, java.sql.Timestamp)
      */
     protected final void updateTimestamp(final String columnLabel, final Timestamp x) throws SQLException {
         rs.updateTimestamp(columnLabel, x);
     }
 
     /**
-     * {@inheritDoc}
+     * @return
+     * @throws SQLException
+     * @see java.sql.ResultSet#wasNull()
      */
     protected final boolean wasNull() throws SQLException {
         return rs.wasNull();


Re: [commons-dbutils] 04/04: DBUTILS-143 Use try-with-resources for all prepareConnection calls Remove closing of connection by private methods that are wrapped in convience methods

Posted by Carl Hall <ca...@gmail.com>.
Both?
I’ll have to ask for a bit of guidance since it looks like DbUtils is heading towards having an o.a.c.dbutils2 package with the 2.0 work from Bill. Should we land 1.8 on master (currently on release branch) then move it to a 1.x branch and replace master with the 2.0 work?

> On Jan 9, 2020, at 5:01 AM, Gary Gregory <ga...@gmail.com> wrote:
> 
> Should this code go in master or a 1.x branch?
> 
> Gary
> 
> On Thu, Jan 9, 2020, 01:18 <th...@apache.org> wrote:
> 
>> This is an automated email from the ASF dual-hosted git repository.
>> 
>> thecarlhall pushed a commit to annotated tag 1.8-RC2
>> in repository https://gitbox.apache.org/repos/asf/commons-dbutils.git
>> 
>> commit 3dc5efb853a4a64176664384d460e28f198c6101
>> Author: Carl Hall <th...@apache.org>
>> AuthorDate: Wed Jan 8 22:14:42 2020 -0800
>> 
>>    DBUTILS-143 Use try-with-resources for all prepareConnection calls
>>    Remove closing of connection by private methods that are wrapped in
>> convience methods
>> ---
>> .../org/apache/commons/dbutils/QueryRunner.java    | 129
>> +++++++--------------
>> .../apache/commons/dbutils/QueryRunnerTest.java    |  11 +-
>> 2 files changed, 44 insertions(+), 96 deletions(-)
>> 
>> diff --git a/src/main/java/org/apache/commons/dbutils/QueryRunner.java
>> b/src/main/java/org/apache/commons/dbutils/QueryRunner.java
>> index f76ce19..6c062f1 100644
>> --- a/src/main/java/org/apache/commons/dbutils/QueryRunner.java
>> +++ b/src/main/java/org/apache/commons/dbutils/QueryRunner.java
>> @@ -146,9 +146,9 @@ public class QueryRunner extends AbstractQueryRunner {
>>      * @since DbUtils 1.1
>>      */
>>     public int[] batch(final String sql, final Object[][] params) throws
>> SQLException {
>> -        final Connection conn = this.prepareConnection();
>> -
>> -        return this.batch(conn, true, sql, params);
>> +        try (final Connection conn = this.prepareConnection()) {
>> +            return this.batch(conn, true, sql, params);
>> +        }
>>     }
>> 
>>     /**
>> @@ -167,16 +167,10 @@ public class QueryRunner extends AbstractQueryRunner
>> {
>>         }
>> 
>>         if (sql == null) {
>> -            if (closeConn) {
>> -                close(conn);
>> -            }
>>             throw new SQLException("Null SQL statement");
>>         }
>> 
>>         if (params == null) {
>> -            if (closeConn) {
>> -                close(conn);
>> -            }
>>             throw new SQLException("Null parameters. If parameters aren't
>> need, pass an empty array.");
>>         }
>> 
>> @@ -195,9 +189,6 @@ public class QueryRunner extends AbstractQueryRunner {
>>             this.rethrow(e, sql, (Object[])params);
>>         } finally {
>>             close(stmt);
>> -            if (closeConn) {
>> -                close(conn);
>> -            }
>>         }
>> 
>>         return rows;
>> @@ -282,9 +273,9 @@ public class QueryRunner extends AbstractQueryRunner {
>>      */
>>     @Deprecated
>>     public <T> T query(final String sql, final Object param, final
>> ResultSetHandler<T> rsh) throws SQLException {
>> -        final Connection conn = this.prepareConnection();
>> -
>> -        return this.<T>query(conn, true, sql, rsh, param);
>> +        try (final Connection conn = this.prepareConnection()) {
>> +            return this.<T>query(conn, true, sql, rsh, param);
>> +        }
>>     }
>> 
>>     /**
>> @@ -305,9 +296,9 @@ public class QueryRunner extends AbstractQueryRunner {
>>      */
>>     @Deprecated
>>     public <T> T query(final String sql, final Object[] params, final
>> ResultSetHandler<T> rsh) throws SQLException {
>> -        final Connection conn = this.prepareConnection();
>> -
>> -        return this.<T>query(conn, true, sql, rsh, params);
>> +        try (final Connection conn = this.prepareConnection()) {
>> +            return this.<T>query(conn, true, sql, rsh, params);
>> +        }
>>     }
>> 
>>     /**
>> @@ -324,9 +315,9 @@ public class QueryRunner extends AbstractQueryRunner {
>>      * @throws SQLException if a database access error occurs
>>      */
>>     public <T> T query(final String sql, final ResultSetHandler<T> rsh,
>> final Object... params) throws SQLException {
>> -        final Connection conn = this.prepareConnection();
>> -
>> -        return this.<T>query(conn, true, sql, rsh, params);
>> +        try (final Connection conn = this.prepareConnection()) {
>> +            return this.<T>query(conn, true, sql, rsh, params);
>> +        }
>>     }
>> 
>>     /**
>> @@ -342,9 +333,9 @@ public class QueryRunner extends AbstractQueryRunner {
>>      * @throws SQLException if a database access error occurs
>>      */
>>     public <T> T query(final String sql, final ResultSetHandler<T> rsh)
>> throws SQLException {
>> -        final Connection conn = this.prepareConnection();
>> -
>> -        return this.<T>query(conn, true, sql, rsh, (Object[]) null);
>> +        try (final Connection conn = this.prepareConnection()) {
>> +            return this.<T>query(conn, true, sql, rsh, (Object[]) null);
>> +        }
>>     }
>> 
>>     /**
>> @@ -364,16 +355,10 @@ public class QueryRunner extends AbstractQueryRunner
>> {
>>         }
>> 
>>         if (sql == null) {
>> -            if (closeConn) {
>> -                close(conn);
>> -            }
>>             throw new SQLException("Null SQL statement");
>>         }
>> 
>>         if (rsh == null) {
>> -            if (closeConn) {
>> -                close(conn);
>> -            }
>>             throw new SQLException("Null ResultSetHandler");
>>         }
>> 
>> @@ -399,9 +384,6 @@ public class QueryRunner extends AbstractQueryRunner {
>>         } finally {
>>             closeQuietly(rs);
>>             closeQuietly(stmt);
>> -            if (closeConn) {
>> -                close(conn);
>> -            }
>>         }
>> 
>>         return result;
>> @@ -459,9 +441,9 @@ public class QueryRunner extends AbstractQueryRunner {
>>      * @return The number of rows updated.
>>      */
>>     public int update(final String sql) throws SQLException {
>> -        final Connection conn = this.prepareConnection();
>> -
>> -        return this.update(conn, true, sql, (Object[]) null);
>> +        try (final Connection conn = this.prepareConnection()) {
>> +            return this.update(conn, true, sql, (Object[]) null);
>> +        }
>>     }
>> 
>>     /**
>> @@ -477,9 +459,9 @@ public class QueryRunner extends AbstractQueryRunner {
>>      * @return The number of rows updated.
>>      */
>>     public int update(final String sql, final Object param) throws
>> SQLException {
>> -        final Connection conn = this.prepareConnection();
>> -
>> -        return this.update(conn, true, sql, param);
>> +        try (final Connection conn = this.prepareConnection()) {
>> +            return this.update(conn, true, sql, param);
>> +        }
>>     }
>> 
>>     /**
>> @@ -495,9 +477,9 @@ public class QueryRunner extends AbstractQueryRunner {
>>      * @return The number of rows updated.
>>      */
>>     public int update(final String sql, final Object... params) throws
>> SQLException {
>> -        final Connection conn = this.prepareConnection();
>> -
>> -        return this.update(conn, true, sql, params);
>> +        try (final Connection conn = this.prepareConnection()) {
>> +            return this.update(conn, true, sql, params);
>> +        }
>>     }
>> 
>>     /**
>> @@ -516,9 +498,6 @@ public class QueryRunner extends AbstractQueryRunner {
>>         }
>> 
>>         if (sql == null) {
>> -            if (closeConn) {
>> -                close(conn);
>> -            }
>>             throw new SQLException("Null SQL statement");
>>         }
>> 
>> @@ -541,9 +520,6 @@ public class QueryRunner extends AbstractQueryRunner {
>> 
>>         } finally {
>>             close(stmt);
>> -            if (closeConn) {
>> -                close(conn);
>> -            }
>>         }
>> 
>>         return rows;
>> @@ -562,7 +538,9 @@ public class QueryRunner extends AbstractQueryRunner {
>>      * @since 1.6
>>      */
>>     public <T> T insert(final String sql, final ResultSetHandler<T> rsh)
>> throws SQLException {
>> -        return insert(this.prepareConnection(), true, sql, rsh,
>> (Object[]) null);
>> +        try (final Connection conn = this.prepareConnection()) {
>> +            return insert(conn, true, sql, rsh, (Object[]) null);
>> +        }
>>     }
>> 
>>     /**
>> @@ -580,7 +558,9 @@ public class QueryRunner extends AbstractQueryRunner {
>>      * @since 1.6
>>      */
>>     public <T> T insert(final String sql, final ResultSetHandler<T> rsh,
>> final Object... params) throws SQLException {
>> -        return insert(this.prepareConnection(), true, sql, rsh, params);
>> +        try (final Connection conn = this.prepareConnection()) {
>> +            return insert(conn, true, sql, rsh, params);
>> +        }
>>     }
>> 
>>     /**
>> @@ -633,16 +613,10 @@ public class QueryRunner extends AbstractQueryRunner
>> {
>>         }
>> 
>>         if (sql == null) {
>> -            if (closeConn) {
>> -                close(conn);
>> -            }
>>             throw new SQLException("Null SQL statement");
>>         }
>> 
>>         if (rsh == null) {
>> -            if (closeConn) {
>> -                close(conn);
>> -            }
>>             throw new SQLException("Null ResultSetHandler");
>>         }
>> 
>> @@ -665,9 +639,6 @@ public class QueryRunner extends AbstractQueryRunner {
>>             this.rethrow(e, sql, params);
>>         } finally {
>>             close(stmt);
>> -            if (closeConn) {
>> -                close(conn);
>> -            }
>>         }
>> 
>>         return generatedKeys;
>> @@ -688,7 +659,9 @@ public class QueryRunner extends AbstractQueryRunner {
>>      * @since 1.6
>>      */
>>     public <T> T insertBatch(final String sql, final ResultSetHandler<T>
>> rsh, final Object[][] params) throws SQLException {
>> -        return insertBatch(this.prepareConnection(), true, sql, rsh,
>> params);
>> +        try (final Connection conn = this.prepareConnection()) {
>> +            return insertBatch(conn, true, sql, rsh, params);
>> +        }
>>     }
>> 
>>     /**
>> @@ -726,16 +699,10 @@ public class QueryRunner extends AbstractQueryRunner
>> {
>>         }
>> 
>>         if (sql == null) {
>> -            if (closeConn) {
>> -                close(conn);
>> -            }
>>             throw new SQLException("Null SQL statement");
>>         }
>> 
>>         if (params == null) {
>> -            if (closeConn) {
>> -                close(conn);
>> -            }
>>             throw new SQLException("Null parameters. If parameters aren't
>> need, pass an empty array.");
>>         }
>> 
>> @@ -756,9 +723,6 @@ public class QueryRunner extends AbstractQueryRunner {
>>             this.rethrow(e, sql, (Object[])params);
>>         } finally {
>>             close(stmt);
>> -            if (closeConn) {
>> -                close(conn);
>> -            }
>>         }
>> 
>>         return generatedKeys;
>> @@ -810,9 +774,9 @@ public class QueryRunner extends AbstractQueryRunner {
>>      * @return The number of rows updated.
>>      */
>>     public int execute(final String sql, final Object... params) throws
>> SQLException {
>> -        final Connection conn = this.prepareConnection();
>> -
>> -        return this.execute(conn, true, sql, params);
>> +        try (final Connection conn = this.prepareConnection()) {
>> +            return this.execute(conn, true, sql, params);
>> +        }
>>     }
>> 
>>     /**
>> @@ -863,9 +827,9 @@ public class QueryRunner extends AbstractQueryRunner {
>>      * @throws SQLException if a database access error occurs
>>      */
>>     public <T> List<T> execute(final String sql, final
>> ResultSetHandler<T> rsh, final Object... params) throws SQLException {
>> -        final Connection conn = this.prepareConnection();
>> -
>> -        return this.execute(conn, true, sql, rsh, params);
>> +        try (final Connection conn = this.prepareConnection()) {
>> +            return this.execute(conn, true, sql, rsh, params);
>> +        }
>>     }
>> 
>>     /**
>> @@ -885,9 +849,6 @@ public class QueryRunner extends AbstractQueryRunner {
>>         }
>> 
>>         if (sql == null) {
>> -            if (closeConn) {
>> -                close(conn);
>> -            }
>>             throw new SQLException("Null SQL statement");
>>         }
>> 
>> @@ -906,9 +867,6 @@ public class QueryRunner extends AbstractQueryRunner {
>> 
>>         } finally {
>>             close(stmt);
>> -            if (closeConn) {
>> -                close(conn);
>> -            }
>>         }
>> 
>>         return rows;
>> @@ -932,16 +890,10 @@ public class QueryRunner extends AbstractQueryRunner
>> {
>>         }
>> 
>>         if (sql == null) {
>> -            if (closeConn) {
>> -                close(conn);
>> -            }
>>             throw new SQLException("Null SQL statement");
>>         }
>> 
>>         if (rsh == null) {
>> -            if (closeConn) {
>> -                close(conn);
>> -            }
>>             throw new SQLException("Null ResultSetHandler");
>>         }
>> 
>> @@ -972,9 +924,6 @@ public class QueryRunner extends AbstractQueryRunner {
>> 
>>         } finally {
>>             close(stmt);
>> -            if (closeConn) {
>> -                close(conn);
>> -            }
>>         }
>> 
>>         return results;
>> diff --git a/src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java
>> b/src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java
>> index 2802c16..c010858 100644
>> --- a/src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java
>> +++ b/src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java
>> @@ -46,7 +46,6 @@ import org.junit.Assert;
>> import org.junit.Before;
>> import org.junit.Test;
>> import org.mockito.Mock;
>> -import org.mockito.Mockito;
>> import org.mockito.MockitoAnnotations;
>> import org.mockito.invocation.InvocationOnMock;
>> import org.mockito.stubbing.Answer;
>> @@ -645,7 +644,7 @@ public class QueryRunnerTest {
>> 
>>         verify(call, times(1)).execute();
>>         verify(call, times(1)).close();    // make sure we closed the
>> statement
>> -        verify(conn, times(1)).close();    // make sure we do not close
>> the connection
>> +        verify(conn, times(1)).close();    // make sure we closed the
>> connection
>> 
>>         // call the other variation of query
>>         when(meta.getParameterCount()).thenReturn(0);
>> @@ -655,7 +654,7 @@ public class QueryRunnerTest {
>> 
>>         verify(call, times(2)).execute();
>>         verify(call, times(2)).close();    // make sure we closed the
>> statement
>> -        verify(conn, times(2)).close();    // make sure we do not close
>> the connection
>> +        verify(conn, times(2)).close();    // make sure we closed the
>> connection
>> 
>>         // Test single OUT parameter
>>         when(meta.getParameterCount()).thenReturn(1);
>> @@ -669,7 +668,7 @@ public class QueryRunnerTest {
>> 
>>         verify(call, times(3)).execute();
>>         verify(call, times(3)).close();    // make sure we closed the
>> statement
>> -        verify(conn, times(3)).close();    // make sure we do not close
>> the connection
>> +        verify(conn, times(3)).close();    // make sure we closed the
>> connection
>> 
>>         // Test OUT parameters with IN parameters
>>         when(meta.getParameterCount()).thenReturn(3);
>> @@ -682,7 +681,7 @@ public class QueryRunnerTest {
>> 
>>         verify(call, times(4)).execute();
>>         verify(call, times(4)).close();    // make sure we closed the
>> statement
>> -        verify(conn, times(4)).close();    // make sure we do not close
>> the connection
>> +        verify(conn, times(4)).close();    // make sure we closed the
>> connection
>> 
>>         // Test INOUT parameters
>>         when(meta.getParameterCount()).thenReturn(3);
>> @@ -699,7 +698,7 @@ public class QueryRunnerTest {
>> 
>>         verify(call, times(5)).execute();
>>         verify(call, times(5)).close();    // make sure we closed the
>> statement
>> -        verify(conn, times(5)).close();    // make sure we do not close
>> the connection
>> +        verify(conn, times(5)).close();    // make sure we closed the
>> connection
>>     }
>> 
>>     @Test
>> 
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [commons-dbutils] 04/04: DBUTILS-143 Use try-with-resources for all prepareConnection calls Remove closing of connection by private methods that are wrapped in convience methods

Posted by Gary Gregory <ga...@gmail.com>.
Should this code go in master or a 1.x branch?

Gary

On Thu, Jan 9, 2020, 01:18 <th...@apache.org> wrote:

> This is an automated email from the ASF dual-hosted git repository.
>
> thecarlhall pushed a commit to annotated tag 1.8-RC2
> in repository https://gitbox.apache.org/repos/asf/commons-dbutils.git
>
> commit 3dc5efb853a4a64176664384d460e28f198c6101
> Author: Carl Hall <th...@apache.org>
> AuthorDate: Wed Jan 8 22:14:42 2020 -0800
>
>     DBUTILS-143 Use try-with-resources for all prepareConnection calls
>     Remove closing of connection by private methods that are wrapped in
> convience methods
> ---
>  .../org/apache/commons/dbutils/QueryRunner.java    | 129
> +++++++--------------
>  .../apache/commons/dbutils/QueryRunnerTest.java    |  11 +-
>  2 files changed, 44 insertions(+), 96 deletions(-)
>
> diff --git a/src/main/java/org/apache/commons/dbutils/QueryRunner.java
> b/src/main/java/org/apache/commons/dbutils/QueryRunner.java
> index f76ce19..6c062f1 100644
> --- a/src/main/java/org/apache/commons/dbutils/QueryRunner.java
> +++ b/src/main/java/org/apache/commons/dbutils/QueryRunner.java
> @@ -146,9 +146,9 @@ public class QueryRunner extends AbstractQueryRunner {
>       * @since DbUtils 1.1
>       */
>      public int[] batch(final String sql, final Object[][] params) throws
> SQLException {
> -        final Connection conn = this.prepareConnection();
> -
> -        return this.batch(conn, true, sql, params);
> +        try (final Connection conn = this.prepareConnection()) {
> +            return this.batch(conn, true, sql, params);
> +        }
>      }
>
>      /**
> @@ -167,16 +167,10 @@ public class QueryRunner extends AbstractQueryRunner
> {
>          }
>
>          if (sql == null) {
> -            if (closeConn) {
> -                close(conn);
> -            }
>              throw new SQLException("Null SQL statement");
>          }
>
>          if (params == null) {
> -            if (closeConn) {
> -                close(conn);
> -            }
>              throw new SQLException("Null parameters. If parameters aren't
> need, pass an empty array.");
>          }
>
> @@ -195,9 +189,6 @@ public class QueryRunner extends AbstractQueryRunner {
>              this.rethrow(e, sql, (Object[])params);
>          } finally {
>              close(stmt);
> -            if (closeConn) {
> -                close(conn);
> -            }
>          }
>
>          return rows;
> @@ -282,9 +273,9 @@ public class QueryRunner extends AbstractQueryRunner {
>       */
>      @Deprecated
>      public <T> T query(final String sql, final Object param, final
> ResultSetHandler<T> rsh) throws SQLException {
> -        final Connection conn = this.prepareConnection();
> -
> -        return this.<T>query(conn, true, sql, rsh, param);
> +        try (final Connection conn = this.prepareConnection()) {
> +            return this.<T>query(conn, true, sql, rsh, param);
> +        }
>      }
>
>      /**
> @@ -305,9 +296,9 @@ public class QueryRunner extends AbstractQueryRunner {
>       */
>      @Deprecated
>      public <T> T query(final String sql, final Object[] params, final
> ResultSetHandler<T> rsh) throws SQLException {
> -        final Connection conn = this.prepareConnection();
> -
> -        return this.<T>query(conn, true, sql, rsh, params);
> +        try (final Connection conn = this.prepareConnection()) {
> +            return this.<T>query(conn, true, sql, rsh, params);
> +        }
>      }
>
>      /**
> @@ -324,9 +315,9 @@ public class QueryRunner extends AbstractQueryRunner {
>       * @throws SQLException if a database access error occurs
>       */
>      public <T> T query(final String sql, final ResultSetHandler<T> rsh,
> final Object... params) throws SQLException {
> -        final Connection conn = this.prepareConnection();
> -
> -        return this.<T>query(conn, true, sql, rsh, params);
> +        try (final Connection conn = this.prepareConnection()) {
> +            return this.<T>query(conn, true, sql, rsh, params);
> +        }
>      }
>
>      /**
> @@ -342,9 +333,9 @@ public class QueryRunner extends AbstractQueryRunner {
>       * @throws SQLException if a database access error occurs
>       */
>      public <T> T query(final String sql, final ResultSetHandler<T> rsh)
> throws SQLException {
> -        final Connection conn = this.prepareConnection();
> -
> -        return this.<T>query(conn, true, sql, rsh, (Object[]) null);
> +        try (final Connection conn = this.prepareConnection()) {
> +            return this.<T>query(conn, true, sql, rsh, (Object[]) null);
> +        }
>      }
>
>      /**
> @@ -364,16 +355,10 @@ public class QueryRunner extends AbstractQueryRunner
> {
>          }
>
>          if (sql == null) {
> -            if (closeConn) {
> -                close(conn);
> -            }
>              throw new SQLException("Null SQL statement");
>          }
>
>          if (rsh == null) {
> -            if (closeConn) {
> -                close(conn);
> -            }
>              throw new SQLException("Null ResultSetHandler");
>          }
>
> @@ -399,9 +384,6 @@ public class QueryRunner extends AbstractQueryRunner {
>          } finally {
>              closeQuietly(rs);
>              closeQuietly(stmt);
> -            if (closeConn) {
> -                close(conn);
> -            }
>          }
>
>          return result;
> @@ -459,9 +441,9 @@ public class QueryRunner extends AbstractQueryRunner {
>       * @return The number of rows updated.
>       */
>      public int update(final String sql) throws SQLException {
> -        final Connection conn = this.prepareConnection();
> -
> -        return this.update(conn, true, sql, (Object[]) null);
> +        try (final Connection conn = this.prepareConnection()) {
> +            return this.update(conn, true, sql, (Object[]) null);
> +        }
>      }
>
>      /**
> @@ -477,9 +459,9 @@ public class QueryRunner extends AbstractQueryRunner {
>       * @return The number of rows updated.
>       */
>      public int update(final String sql, final Object param) throws
> SQLException {
> -        final Connection conn = this.prepareConnection();
> -
> -        return this.update(conn, true, sql, param);
> +        try (final Connection conn = this.prepareConnection()) {
> +            return this.update(conn, true, sql, param);
> +        }
>      }
>
>      /**
> @@ -495,9 +477,9 @@ public class QueryRunner extends AbstractQueryRunner {
>       * @return The number of rows updated.
>       */
>      public int update(final String sql, final Object... params) throws
> SQLException {
> -        final Connection conn = this.prepareConnection();
> -
> -        return this.update(conn, true, sql, params);
> +        try (final Connection conn = this.prepareConnection()) {
> +            return this.update(conn, true, sql, params);
> +        }
>      }
>
>      /**
> @@ -516,9 +498,6 @@ public class QueryRunner extends AbstractQueryRunner {
>          }
>
>          if (sql == null) {
> -            if (closeConn) {
> -                close(conn);
> -            }
>              throw new SQLException("Null SQL statement");
>          }
>
> @@ -541,9 +520,6 @@ public class QueryRunner extends AbstractQueryRunner {
>
>          } finally {
>              close(stmt);
> -            if (closeConn) {
> -                close(conn);
> -            }
>          }
>
>          return rows;
> @@ -562,7 +538,9 @@ public class QueryRunner extends AbstractQueryRunner {
>       * @since 1.6
>       */
>      public <T> T insert(final String sql, final ResultSetHandler<T> rsh)
> throws SQLException {
> -        return insert(this.prepareConnection(), true, sql, rsh,
> (Object[]) null);
> +        try (final Connection conn = this.prepareConnection()) {
> +            return insert(conn, true, sql, rsh, (Object[]) null);
> +        }
>      }
>
>      /**
> @@ -580,7 +558,9 @@ public class QueryRunner extends AbstractQueryRunner {
>       * @since 1.6
>       */
>      public <T> T insert(final String sql, final ResultSetHandler<T> rsh,
> final Object... params) throws SQLException {
> -        return insert(this.prepareConnection(), true, sql, rsh, params);
> +        try (final Connection conn = this.prepareConnection()) {
> +            return insert(conn, true, sql, rsh, params);
> +        }
>      }
>
>      /**
> @@ -633,16 +613,10 @@ public class QueryRunner extends AbstractQueryRunner
> {
>          }
>
>          if (sql == null) {
> -            if (closeConn) {
> -                close(conn);
> -            }
>              throw new SQLException("Null SQL statement");
>          }
>
>          if (rsh == null) {
> -            if (closeConn) {
> -                close(conn);
> -            }
>              throw new SQLException("Null ResultSetHandler");
>          }
>
> @@ -665,9 +639,6 @@ public class QueryRunner extends AbstractQueryRunner {
>              this.rethrow(e, sql, params);
>          } finally {
>              close(stmt);
> -            if (closeConn) {
> -                close(conn);
> -            }
>          }
>
>          return generatedKeys;
> @@ -688,7 +659,9 @@ public class QueryRunner extends AbstractQueryRunner {
>       * @since 1.6
>       */
>      public <T> T insertBatch(final String sql, final ResultSetHandler<T>
> rsh, final Object[][] params) throws SQLException {
> -        return insertBatch(this.prepareConnection(), true, sql, rsh,
> params);
> +        try (final Connection conn = this.prepareConnection()) {
> +            return insertBatch(conn, true, sql, rsh, params);
> +        }
>      }
>
>      /**
> @@ -726,16 +699,10 @@ public class QueryRunner extends AbstractQueryRunner
> {
>          }
>
>          if (sql == null) {
> -            if (closeConn) {
> -                close(conn);
> -            }
>              throw new SQLException("Null SQL statement");
>          }
>
>          if (params == null) {
> -            if (closeConn) {
> -                close(conn);
> -            }
>              throw new SQLException("Null parameters. If parameters aren't
> need, pass an empty array.");
>          }
>
> @@ -756,9 +723,6 @@ public class QueryRunner extends AbstractQueryRunner {
>              this.rethrow(e, sql, (Object[])params);
>          } finally {
>              close(stmt);
> -            if (closeConn) {
> -                close(conn);
> -            }
>          }
>
>          return generatedKeys;
> @@ -810,9 +774,9 @@ public class QueryRunner extends AbstractQueryRunner {
>       * @return The number of rows updated.
>       */
>      public int execute(final String sql, final Object... params) throws
> SQLException {
> -        final Connection conn = this.prepareConnection();
> -
> -        return this.execute(conn, true, sql, params);
> +        try (final Connection conn = this.prepareConnection()) {
> +            return this.execute(conn, true, sql, params);
> +        }
>      }
>
>      /**
> @@ -863,9 +827,9 @@ public class QueryRunner extends AbstractQueryRunner {
>       * @throws SQLException if a database access error occurs
>       */
>      public <T> List<T> execute(final String sql, final
> ResultSetHandler<T> rsh, final Object... params) throws SQLException {
> -        final Connection conn = this.prepareConnection();
> -
> -        return this.execute(conn, true, sql, rsh, params);
> +        try (final Connection conn = this.prepareConnection()) {
> +            return this.execute(conn, true, sql, rsh, params);
> +        }
>      }
>
>      /**
> @@ -885,9 +849,6 @@ public class QueryRunner extends AbstractQueryRunner {
>          }
>
>          if (sql == null) {
> -            if (closeConn) {
> -                close(conn);
> -            }
>              throw new SQLException("Null SQL statement");
>          }
>
> @@ -906,9 +867,6 @@ public class QueryRunner extends AbstractQueryRunner {
>
>          } finally {
>              close(stmt);
> -            if (closeConn) {
> -                close(conn);
> -            }
>          }
>
>          return rows;
> @@ -932,16 +890,10 @@ public class QueryRunner extends AbstractQueryRunner
> {
>          }
>
>          if (sql == null) {
> -            if (closeConn) {
> -                close(conn);
> -            }
>              throw new SQLException("Null SQL statement");
>          }
>
>          if (rsh == null) {
> -            if (closeConn) {
> -                close(conn);
> -            }
>              throw new SQLException("Null ResultSetHandler");
>          }
>
> @@ -972,9 +924,6 @@ public class QueryRunner extends AbstractQueryRunner {
>
>          } finally {
>              close(stmt);
> -            if (closeConn) {
> -                close(conn);
> -            }
>          }
>
>          return results;
> diff --git a/src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java
> b/src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java
> index 2802c16..c010858 100644
> --- a/src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java
> +++ b/src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java
> @@ -46,7 +46,6 @@ import org.junit.Assert;
>  import org.junit.Before;
>  import org.junit.Test;
>  import org.mockito.Mock;
> -import org.mockito.Mockito;
>  import org.mockito.MockitoAnnotations;
>  import org.mockito.invocation.InvocationOnMock;
>  import org.mockito.stubbing.Answer;
> @@ -645,7 +644,7 @@ public class QueryRunnerTest {
>
>          verify(call, times(1)).execute();
>          verify(call, times(1)).close();    // make sure we closed the
> statement
> -        verify(conn, times(1)).close();    // make sure we do not close
> the connection
> +        verify(conn, times(1)).close();    // make sure we closed the
> connection
>
>          // call the other variation of query
>          when(meta.getParameterCount()).thenReturn(0);
> @@ -655,7 +654,7 @@ public class QueryRunnerTest {
>
>          verify(call, times(2)).execute();
>          verify(call, times(2)).close();    // make sure we closed the
> statement
> -        verify(conn, times(2)).close();    // make sure we do not close
> the connection
> +        verify(conn, times(2)).close();    // make sure we closed the
> connection
>
>          // Test single OUT parameter
>          when(meta.getParameterCount()).thenReturn(1);
> @@ -669,7 +668,7 @@ public class QueryRunnerTest {
>
>          verify(call, times(3)).execute();
>          verify(call, times(3)).close();    // make sure we closed the
> statement
> -        verify(conn, times(3)).close();    // make sure we do not close
> the connection
> +        verify(conn, times(3)).close();    // make sure we closed the
> connection
>
>          // Test OUT parameters with IN parameters
>          when(meta.getParameterCount()).thenReturn(3);
> @@ -682,7 +681,7 @@ public class QueryRunnerTest {
>
>          verify(call, times(4)).execute();
>          verify(call, times(4)).close();    // make sure we closed the
> statement
> -        verify(conn, times(4)).close();    // make sure we do not close
> the connection
> +        verify(conn, times(4)).close();    // make sure we closed the
> connection
>
>          // Test INOUT parameters
>          when(meta.getParameterCount()).thenReturn(3);
> @@ -699,7 +698,7 @@ public class QueryRunnerTest {
>
>          verify(call, times(5)).execute();
>          verify(call, times(5)).close();    // make sure we closed the
> statement
> -        verify(conn, times(5)).close();    // make sure we do not close
> the connection
> +        verify(conn, times(5)).close();    // make sure we closed the
> connection
>      }
>
>      @Test
>
>

[commons-dbutils] 04/04: DBUTILS-143 Use try-with-resources for all prepareConnection calls Remove closing of connection by private methods that are wrapped in convience methods

Posted by th...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

thecarlhall pushed a commit to annotated tag 1.8-RC2
in repository https://gitbox.apache.org/repos/asf/commons-dbutils.git

commit 3dc5efb853a4a64176664384d460e28f198c6101
Author: Carl Hall <th...@apache.org>
AuthorDate: Wed Jan 8 22:14:42 2020 -0800

    DBUTILS-143 Use try-with-resources for all prepareConnection calls
    Remove closing of connection by private methods that are wrapped in convience methods
---
 .../org/apache/commons/dbutils/QueryRunner.java    | 129 +++++++--------------
 .../apache/commons/dbutils/QueryRunnerTest.java    |  11 +-
 2 files changed, 44 insertions(+), 96 deletions(-)

diff --git a/src/main/java/org/apache/commons/dbutils/QueryRunner.java b/src/main/java/org/apache/commons/dbutils/QueryRunner.java
index f76ce19..6c062f1 100644
--- a/src/main/java/org/apache/commons/dbutils/QueryRunner.java
+++ b/src/main/java/org/apache/commons/dbutils/QueryRunner.java
@@ -146,9 +146,9 @@ public class QueryRunner extends AbstractQueryRunner {
      * @since DbUtils 1.1
      */
     public int[] batch(final String sql, final Object[][] params) throws SQLException {
-        final Connection conn = this.prepareConnection();
-
-        return this.batch(conn, true, sql, params);
+        try (final Connection conn = this.prepareConnection()) {
+            return this.batch(conn, true, sql, params);
+        }
     }
 
     /**
@@ -167,16 +167,10 @@ public class QueryRunner extends AbstractQueryRunner {
         }
 
         if (sql == null) {
-            if (closeConn) {
-                close(conn);
-            }
             throw new SQLException("Null SQL statement");
         }
 
         if (params == null) {
-            if (closeConn) {
-                close(conn);
-            }
             throw new SQLException("Null parameters. If parameters aren't need, pass an empty array.");
         }
 
@@ -195,9 +189,6 @@ public class QueryRunner extends AbstractQueryRunner {
             this.rethrow(e, sql, (Object[])params);
         } finally {
             close(stmt);
-            if (closeConn) {
-                close(conn);
-            }
         }
 
         return rows;
@@ -282,9 +273,9 @@ public class QueryRunner extends AbstractQueryRunner {
      */
     @Deprecated
     public <T> T query(final String sql, final Object param, final ResultSetHandler<T> rsh) throws SQLException {
-        final Connection conn = this.prepareConnection();
-
-        return this.<T>query(conn, true, sql, rsh, param);
+        try (final Connection conn = this.prepareConnection()) {
+            return this.<T>query(conn, true, sql, rsh, param);
+        }
     }
 
     /**
@@ -305,9 +296,9 @@ public class QueryRunner extends AbstractQueryRunner {
      */
     @Deprecated
     public <T> T query(final String sql, final Object[] params, final ResultSetHandler<T> rsh) throws SQLException {
-        final Connection conn = this.prepareConnection();
-
-        return this.<T>query(conn, true, sql, rsh, params);
+        try (final Connection conn = this.prepareConnection()) {
+            return this.<T>query(conn, true, sql, rsh, params);
+        }
     }
 
     /**
@@ -324,9 +315,9 @@ public class QueryRunner extends AbstractQueryRunner {
      * @throws SQLException if a database access error occurs
      */
     public <T> T query(final String sql, final ResultSetHandler<T> rsh, final Object... params) throws SQLException {
-        final Connection conn = this.prepareConnection();
-
-        return this.<T>query(conn, true, sql, rsh, params);
+        try (final Connection conn = this.prepareConnection()) {
+            return this.<T>query(conn, true, sql, rsh, params);
+        }
     }
 
     /**
@@ -342,9 +333,9 @@ public class QueryRunner extends AbstractQueryRunner {
      * @throws SQLException if a database access error occurs
      */
     public <T> T query(final String sql, final ResultSetHandler<T> rsh) throws SQLException {
-        final Connection conn = this.prepareConnection();
-
-        return this.<T>query(conn, true, sql, rsh, (Object[]) null);
+        try (final Connection conn = this.prepareConnection()) {
+            return this.<T>query(conn, true, sql, rsh, (Object[]) null);
+        }
     }
 
     /**
@@ -364,16 +355,10 @@ public class QueryRunner extends AbstractQueryRunner {
         }
 
         if (sql == null) {
-            if (closeConn) {
-                close(conn);
-            }
             throw new SQLException("Null SQL statement");
         }
 
         if (rsh == null) {
-            if (closeConn) {
-                close(conn);
-            }
             throw new SQLException("Null ResultSetHandler");
         }
 
@@ -399,9 +384,6 @@ public class QueryRunner extends AbstractQueryRunner {
         } finally {
             closeQuietly(rs);
             closeQuietly(stmt);
-            if (closeConn) {
-                close(conn);
-            }
         }
 
         return result;
@@ -459,9 +441,9 @@ public class QueryRunner extends AbstractQueryRunner {
      * @return The number of rows updated.
      */
     public int update(final String sql) throws SQLException {
-        final Connection conn = this.prepareConnection();
-
-        return this.update(conn, true, sql, (Object[]) null);
+        try (final Connection conn = this.prepareConnection()) {
+            return this.update(conn, true, sql, (Object[]) null);
+        }
     }
 
     /**
@@ -477,9 +459,9 @@ public class QueryRunner extends AbstractQueryRunner {
      * @return The number of rows updated.
      */
     public int update(final String sql, final Object param) throws SQLException {
-        final Connection conn = this.prepareConnection();
-
-        return this.update(conn, true, sql, param);
+        try (final Connection conn = this.prepareConnection()) {
+            return this.update(conn, true, sql, param);
+        }
     }
 
     /**
@@ -495,9 +477,9 @@ public class QueryRunner extends AbstractQueryRunner {
      * @return The number of rows updated.
      */
     public int update(final String sql, final Object... params) throws SQLException {
-        final Connection conn = this.prepareConnection();
-
-        return this.update(conn, true, sql, params);
+        try (final Connection conn = this.prepareConnection()) {
+            return this.update(conn, true, sql, params);
+        }
     }
 
     /**
@@ -516,9 +498,6 @@ public class QueryRunner extends AbstractQueryRunner {
         }
 
         if (sql == null) {
-            if (closeConn) {
-                close(conn);
-            }
             throw new SQLException("Null SQL statement");
         }
 
@@ -541,9 +520,6 @@ public class QueryRunner extends AbstractQueryRunner {
 
         } finally {
             close(stmt);
-            if (closeConn) {
-                close(conn);
-            }
         }
 
         return rows;
@@ -562,7 +538,9 @@ public class QueryRunner extends AbstractQueryRunner {
      * @since 1.6
      */
     public <T> T insert(final String sql, final ResultSetHandler<T> rsh) throws SQLException {
-        return insert(this.prepareConnection(), true, sql, rsh, (Object[]) null);
+        try (final Connection conn = this.prepareConnection()) {
+            return insert(conn, true, sql, rsh, (Object[]) null);
+        }
     }
 
     /**
@@ -580,7 +558,9 @@ public class QueryRunner extends AbstractQueryRunner {
      * @since 1.6
      */
     public <T> T insert(final String sql, final ResultSetHandler<T> rsh, final Object... params) throws SQLException {
-        return insert(this.prepareConnection(), true, sql, rsh, params);
+        try (final Connection conn = this.prepareConnection()) {
+            return insert(conn, true, sql, rsh, params);
+        }
     }
 
     /**
@@ -633,16 +613,10 @@ public class QueryRunner extends AbstractQueryRunner {
         }
 
         if (sql == null) {
-            if (closeConn) {
-                close(conn);
-            }
             throw new SQLException("Null SQL statement");
         }
 
         if (rsh == null) {
-            if (closeConn) {
-                close(conn);
-            }
             throw new SQLException("Null ResultSetHandler");
         }
 
@@ -665,9 +639,6 @@ public class QueryRunner extends AbstractQueryRunner {
             this.rethrow(e, sql, params);
         } finally {
             close(stmt);
-            if (closeConn) {
-                close(conn);
-            }
         }
 
         return generatedKeys;
@@ -688,7 +659,9 @@ public class QueryRunner extends AbstractQueryRunner {
      * @since 1.6
      */
     public <T> T insertBatch(final String sql, final ResultSetHandler<T> rsh, final Object[][] params) throws SQLException {
-        return insertBatch(this.prepareConnection(), true, sql, rsh, params);
+        try (final Connection conn = this.prepareConnection()) {
+            return insertBatch(conn, true, sql, rsh, params);
+        }
     }
 
     /**
@@ -726,16 +699,10 @@ public class QueryRunner extends AbstractQueryRunner {
         }
 
         if (sql == null) {
-            if (closeConn) {
-                close(conn);
-            }
             throw new SQLException("Null SQL statement");
         }
 
         if (params == null) {
-            if (closeConn) {
-                close(conn);
-            }
             throw new SQLException("Null parameters. If parameters aren't need, pass an empty array.");
         }
 
@@ -756,9 +723,6 @@ public class QueryRunner extends AbstractQueryRunner {
             this.rethrow(e, sql, (Object[])params);
         } finally {
             close(stmt);
-            if (closeConn) {
-                close(conn);
-            }
         }
 
         return generatedKeys;
@@ -810,9 +774,9 @@ public class QueryRunner extends AbstractQueryRunner {
      * @return The number of rows updated.
      */
     public int execute(final String sql, final Object... params) throws SQLException {
-        final Connection conn = this.prepareConnection();
-
-        return this.execute(conn, true, sql, params);
+        try (final Connection conn = this.prepareConnection()) {
+            return this.execute(conn, true, sql, params);
+        }
     }
 
     /**
@@ -863,9 +827,9 @@ public class QueryRunner extends AbstractQueryRunner {
      * @throws SQLException if a database access error occurs
      */
     public <T> List<T> execute(final String sql, final ResultSetHandler<T> rsh, final Object... params) throws SQLException {
-        final Connection conn = this.prepareConnection();
-
-        return this.execute(conn, true, sql, rsh, params);
+        try (final Connection conn = this.prepareConnection()) {
+            return this.execute(conn, true, sql, rsh, params);
+        }
     }
 
     /**
@@ -885,9 +849,6 @@ public class QueryRunner extends AbstractQueryRunner {
         }
 
         if (sql == null) {
-            if (closeConn) {
-                close(conn);
-            }
             throw new SQLException("Null SQL statement");
         }
 
@@ -906,9 +867,6 @@ public class QueryRunner extends AbstractQueryRunner {
 
         } finally {
             close(stmt);
-            if (closeConn) {
-                close(conn);
-            }
         }
 
         return rows;
@@ -932,16 +890,10 @@ public class QueryRunner extends AbstractQueryRunner {
         }
 
         if (sql == null) {
-            if (closeConn) {
-                close(conn);
-            }
             throw new SQLException("Null SQL statement");
         }
 
         if (rsh == null) {
-            if (closeConn) {
-                close(conn);
-            }
             throw new SQLException("Null ResultSetHandler");
         }
 
@@ -972,9 +924,6 @@ public class QueryRunner extends AbstractQueryRunner {
 
         } finally {
             close(stmt);
-            if (closeConn) {
-                close(conn);
-            }
         }
 
         return results;
diff --git a/src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java b/src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java
index 2802c16..c010858 100644
--- a/src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java
+++ b/src/test/java/org/apache/commons/dbutils/QueryRunnerTest.java
@@ -46,7 +46,6 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mock;
-import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
@@ -645,7 +644,7 @@ public class QueryRunnerTest {
 
         verify(call, times(1)).execute();
         verify(call, times(1)).close();    // make sure we closed the statement
-        verify(conn, times(1)).close();    // make sure we do not close the connection
+        verify(conn, times(1)).close();    // make sure we closed the connection
 
         // call the other variation of query
         when(meta.getParameterCount()).thenReturn(0);
@@ -655,7 +654,7 @@ public class QueryRunnerTest {
 
         verify(call, times(2)).execute();
         verify(call, times(2)).close();    // make sure we closed the statement
-        verify(conn, times(2)).close();    // make sure we do not close the connection
+        verify(conn, times(2)).close();    // make sure we closed the connection
 
         // Test single OUT parameter
         when(meta.getParameterCount()).thenReturn(1);
@@ -669,7 +668,7 @@ public class QueryRunnerTest {
 
         verify(call, times(3)).execute();
         verify(call, times(3)).close();    // make sure we closed the statement
-        verify(conn, times(3)).close();    // make sure we do not close the connection
+        verify(conn, times(3)).close();    // make sure we closed the connection
 
         // Test OUT parameters with IN parameters
         when(meta.getParameterCount()).thenReturn(3);
@@ -682,7 +681,7 @@ public class QueryRunnerTest {
 
         verify(call, times(4)).execute();
         verify(call, times(4)).close();    // make sure we closed the statement
-        verify(conn, times(4)).close();    // make sure we do not close the connection
+        verify(conn, times(4)).close();    // make sure we closed the connection
 
         // Test INOUT parameters
         when(meta.getParameterCount()).thenReturn(3);
@@ -699,7 +698,7 @@ public class QueryRunnerTest {
 
         verify(call, times(5)).execute();
         verify(call, times(5)).close();    // make sure we closed the statement
-        verify(conn, times(5)).close();    // make sure we do not close the connection
+        verify(conn, times(5)).close();    // make sure we closed the connection
     }
 
     @Test


[commons-dbutils] 01/04: Update release notes to accumulate starting with version 1.6

Posted by th...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

thecarlhall pushed a commit to annotated tag 1.8-RC2
in repository https://gitbox.apache.org/repos/asf/commons-dbutils.git

commit c2c387cc3d6fa807be14e08c4e4fee453f091dcd
Author: Carl Hall <th...@apache.org>
AuthorDate: Mon Jan 6 21:30:40 2020 -0800

    Update release notes to accumulate starting with version 1.6
---
 RELEASE-NOTES.txt            | 87 ++++++++++++++++++++++++++++++++++++++++++--
 src/changes/release-notes.vm |  2 +-
 2 files changed, 84 insertions(+), 5 deletions(-)

diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index 421be73..470d14b 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -16,15 +16,15 @@ o PR/9:         Add @Column annotation to hint the field name instead of dissect
 o DBUTILS-136:  CaseInsensitiveHashMap cannot be accessed by subclasses of BasicRowProcessor; add org.apache.commons.dbutils.BasicRowProcessor.createCaseInsensitiveHashMap(int). Thanks to Matthew Hall, Gary Gregory. 
 
 Fixed Bugs:
-o DBUTILS-131:  Speedup query calls without parameters; Use PreparedStatement only when parameters are present. Thanks to yairlenga. 
-o           Always copy Date, Time, Timestamp on get and set in SqlNullCheckedResultSet. 
-o DBUTILS-138:  org.apache.commons.dbutils.QueryRunner.query(Connection, boolean, String, ResultSetHandler<T>, Object...) Exception in closing statement leave connections open. Thanks to Stefano Lissa, Gary Gregory. 
+o Always copy Date, Time, Timestamp on get and set in SqlNullCheckedResultSet.
+o DBUTILS-131:  Speedup query calls without parameters; Use PreparedStatement only when parameters are present. Thanks to yairlenga.
+o DBUTILS-138:  org.apache.commons.dbutils.QueryRunner.query(Connection, boolean, String, ResultSetHandler<T>, Object...) Exception in closing statement leave connections open. Thanks to Stefano Lissa, Gary Gregory.
 o DBUTILS-139:  Update Java requirement from version 6 to 7. Thanks to Gary Gregory. 
 
 Changes:
 o DBUTILS-135:  BeanProcessor is not thread safe since [DBUTILS-124]. Thanks to hdevalke. 
 o DBUTILS-137:  Inefficient allocation of Maps in org.apache.commons.dbutils.BasicRowProcessor.toMap(ResultSet). Thanks to Gary Gregory. 
-o           clirr, checkstyle, and spotbugs configured as part of default build. Thanks to thecarlhall. 
+o clirr, checkstyle, and spotbugs configured as part of default build. Thanks to thecarlhall.
 
 
 For complete information on Apache Commons DbUtils, including instructions on how to submit bug reports,
@@ -32,4 +32,83 @@ patches, or suggestions for improvement, see the Apache Apache Commons DbUtils w
 
 https://commons.apache.org/proper/commons-dbutils/
 
+Download it from https://commons.apache.org/proper/commons-dbutils/download_dbutils.cgi
 
+================================================================================
+
+               Apache Commons DbUtils
+                      Version 1.7
+                     RELEASE NOTES
+
+The Apache Commons DbUtils team is pleased to announce the release of Apache Commons DbUtils 1.7
+
+The Apache Commons DbUtils package is a set of Java utility classes for easing JDBC development.
+
+Bugfixes and separate column & property handlers using SPI
+
+Changes in this version include:
+
+New features:
+o DBUTILS-121:  Add getWriteMethod to BeanProcessor to allow subclasses to influence which write method is used
+o DBUTILS-50:  Support CallableStatement "out" parameters Thanks to Dan Fabulich.
+o DBUTILS-124:  Implement column and property handlers using Java's service interfaces.
+
+Fixed Bugs:
+o DBUTILS-82:  Change method contracts to allow extended class types when returning a bean populated from a query Thanks to Kenshi Toriumi.
+o DBUTILS-89:  Add method in BeanProcessor to populate an existing bean Thanks to Adam Dyga.
+o DBUTILS-70:  Add ability to configure statements used in QueryRunner Thanks to Michael Akerman.
+
+Changes:
+o DBUTILS-117:  Error handling possible getParameterMetaData() results
+        - allow for null return
+        - handle SQLFeatureNotSupportedException Thanks to Vadim Smirnov.
+o DBUTILS-119:  Correct errors in BeanMapHandler Javadoc Thanks to Michael Akerman.
+o PR/1:  Created some Unit Tests to increase code coverage. Thanks to Michael Hausegger.
+
+================================================================================
+
+              Apache Commons DbUtils
+                     Version 1.6
+                    RELEASE NOTES
+
+The Apache Commons DbUtils team is pleased to announce the release of Apache Commons DbUtils 1.6.
+The Apache Commons DbUtils package is a set of Java utility classes for easing JDBC development.
+
+Changes in this version include:
+
+NEW FEATURES:
+=============
+o DBUTILS-113:  Add support for conversion of ResultSet strings to enums in the BeanProcessor
+                Thanks to Graylin Kim, Michael Osipov.
+o DBUTILS-108:  Create functionality to return auto-generated keys in batches of SQL inserts
+                Thanks to Micah Huff.
+o DBUTILS-107:  Patch QueryLoader to also load from XML properties files
+                Thanks to PB.
+o DBUTILS-98:   Add missing JavaDoc to QueryRunner#insert
+                Thanks to Moandji Ezana.
+o DBUTILS-97:   Add an Abstract ResultSetHandler implementation in order to reduce redundant 'resultSet' variable invocation
+o DBUTILS-87:   Added insert methods to QueryRunner and AsyncQueryRunner that return the generated key.
+                Thanks to Moandji Ezana.
+
+FIXED BUGS:
+===========
+o DBUTILS-110:  ArrayHandler should return an empty array when handle has no rows 
+o DBUTILS-114:  Order of columns not retained in BasicRowProcessor with HashMap
+                Thanks to Michael Osipov.
+o DBUTILS-118:  BeanProcessor not returning nanoseconds
+                Thanks to Feysal Rujbally, Daniele Cremonini.
+o DBUTILS-106:  DBUtils can't build using JDK 1.7 - DriverProxy needs to implement getParentLogger()
+                Add dynamic invocation. Thanks to Niall Pemberton.
+o DBUTILS-100:  Updated the use of getColumnName to try getColumnLabel first Thanks to xiaofei.xu. 
+o DBUTILS-96:   DbUtils#loadDriver(ClassLoader,String) makes DriverManager throwing "No suitable driver found for jdbc"
+                if ClassLoader is not the System's one Thanks to yuyf.
+
+Changes:
+o DBUTILS-85:   In BeanProcessor#isCompatibleType, can Integer.class.isInstance(value) be replaced by value instanceof Integer (etc)?
+                Simplified code by using instanceof.
+
+
+For complete information on Apache Commons DbUtils, including instructions on how to submit bug reports,
+patches, or suggestions for improvement, see the Apache Apache Commons DbUtils website:
+
+http://commons.apache.org/proper/commons-dbutils/
diff --git a/src/changes/release-notes.vm b/src/changes/release-notes.vm
index 6944be0..8d6a5d8 100644
--- a/src/changes/release-notes.vm
+++ b/src/changes/release-notes.vm
@@ -140,4 +140,4 @@ patches, or suggestions for improvement, see the Apache ${project.name} website:
 
 ${project.url}
 
-
+Download it from ${project.url}/download_text.cgi