commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject svn commit: r916835 [14/41] - in /websites/production/commons/content/proper/commons-dbutils: ./ apidocs/ apidocs/org/apache/commons/dbutils/ apidocs/org/apache/commons/dbutils/class-use/ apidocs/org/apache/commons/dbutils/handlers/ apidocs/org/apache/...
Date Sun, 20 Jul 2014 08:52:25 GMT
Modified: websites/production/commons/content/proper/commons-dbutils/apidocs/src-html/org/apache/commons/dbutils/QueryRunner.html
==============================================================================
--- websites/production/commons/content/proper/commons-dbutils/apidocs/src-html/org/apache/commons/dbutils/QueryRunner.html (original)
+++ websites/production/commons/content/proper/commons-dbutils/apidocs/src-html/org/apache/commons/dbutils/QueryRunner.html Sun Jul 20 08:52:20 2014
@@ -585,136 +585,138 @@
 <span class="sourceLineNo">577</span>     * @throws SQLException If there are database or parameter errors.<a name="line.577"></a>
 <span class="sourceLineNo">578</span>     * @since 1.6<a name="line.578"></a>
 <span class="sourceLineNo">579</span>     */<a name="line.579"></a>
-<span class="sourceLineNo">580</span>    private &lt;T&gt; T insert(Connection conn, boolean closeConn, String sql, ResultSetHandler&lt;T&gt; rsh, Object... params) throws SQLException {<a name="line.580"></a>
-<span class="sourceLineNo">581</span>        if (conn == null) {<a name="line.581"></a>
-<span class="sourceLineNo">582</span>            throw new SQLException("Null connection");<a name="line.582"></a>
-<span class="sourceLineNo">583</span>        }<a name="line.583"></a>
-<span class="sourceLineNo">584</span><a name="line.584"></a>
-<span class="sourceLineNo">585</span>        if (sql == null) {<a name="line.585"></a>
-<span class="sourceLineNo">586</span>            if (closeConn) {<a name="line.586"></a>
-<span class="sourceLineNo">587</span>                close(conn);<a name="line.587"></a>
-<span class="sourceLineNo">588</span>            }<a name="line.588"></a>
-<span class="sourceLineNo">589</span>            throw new SQLException("Null SQL statement");<a name="line.589"></a>
-<span class="sourceLineNo">590</span>        }<a name="line.590"></a>
-<span class="sourceLineNo">591</span><a name="line.591"></a>
-<span class="sourceLineNo">592</span>        if (rsh == null) {<a name="line.592"></a>
-<span class="sourceLineNo">593</span>            if (closeConn) {<a name="line.593"></a>
-<span class="sourceLineNo">594</span>                close(conn);<a name="line.594"></a>
-<span class="sourceLineNo">595</span>            }<a name="line.595"></a>
-<span class="sourceLineNo">596</span>            throw new SQLException("Null ResultSetHandler");<a name="line.596"></a>
-<span class="sourceLineNo">597</span>        }<a name="line.597"></a>
-<span class="sourceLineNo">598</span><a name="line.598"></a>
-<span class="sourceLineNo">599</span>        PreparedStatement stmt = null;<a name="line.599"></a>
-<span class="sourceLineNo">600</span>        T generatedKeys = null;<a name="line.600"></a>
-<span class="sourceLineNo">601</span><a name="line.601"></a>
-<span class="sourceLineNo">602</span>        try {<a name="line.602"></a>
-<span class="sourceLineNo">603</span>            stmt = conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);<a name="line.603"></a>
-<span class="sourceLineNo">604</span>            this.fillStatement(stmt, params);<a name="line.604"></a>
-<span class="sourceLineNo">605</span>            stmt.executeUpdate();<a name="line.605"></a>
-<span class="sourceLineNo">606</span>            ResultSet resultSet = stmt.getGeneratedKeys();<a name="line.606"></a>
-<span class="sourceLineNo">607</span>            generatedKeys = rsh.handle(resultSet);<a name="line.607"></a>
-<span class="sourceLineNo">608</span>        } catch (SQLException e) {<a name="line.608"></a>
-<span class="sourceLineNo">609</span>            this.rethrow(e, sql, params);<a name="line.609"></a>
-<span class="sourceLineNo">610</span>        } finally {<a name="line.610"></a>
-<span class="sourceLineNo">611</span>            close(stmt);<a name="line.611"></a>
-<span class="sourceLineNo">612</span>            if (closeConn) {<a name="line.612"></a>
-<span class="sourceLineNo">613</span>                close(conn);<a name="line.613"></a>
-<span class="sourceLineNo">614</span>            }<a name="line.614"></a>
-<span class="sourceLineNo">615</span>        }<a name="line.615"></a>
-<span class="sourceLineNo">616</span><a name="line.616"></a>
-<span class="sourceLineNo">617</span>        return generatedKeys;<a name="line.617"></a>
-<span class="sourceLineNo">618</span>    }<a name="line.618"></a>
-<span class="sourceLineNo">619</span><a name="line.619"></a>
-<span class="sourceLineNo">620</span>    /**<a name="line.620"></a>
-<span class="sourceLineNo">621</span>     * Executes the given batch of INSERT SQL statements. The<a name="line.621"></a>
-<span class="sourceLineNo">622</span>     * &lt;code&gt;Connection&lt;/code&gt; is retrieved from the &lt;code&gt;DataSource&lt;/code&gt;<a name="line.622"></a>
-<span class="sourceLineNo">623</span>     * set in the constructor.  This &lt;code&gt;Connection&lt;/code&gt; must be in<a name="line.623"></a>
-<span class="sourceLineNo">624</span>     * auto-commit mode or the insert will not be saved.<a name="line.624"></a>
-<span class="sourceLineNo">625</span>     * @param &lt;T&gt; The type of object that the handler returns<a name="line.625"></a>
-<span class="sourceLineNo">626</span>     * @param sql The SQL statement to execute.<a name="line.626"></a>
-<span class="sourceLineNo">627</span>     * @param rsh The handler used to create the result object from<a name="line.627"></a>
-<span class="sourceLineNo">628</span>     * the &lt;code&gt;ResultSet&lt;/code&gt; of auto-generated keys.<a name="line.628"></a>
-<span class="sourceLineNo">629</span>     * @param params Initializes the PreparedStatement's IN (i.e. '?')<a name="line.629"></a>
-<span class="sourceLineNo">630</span>     * @return The result generated by the handler.<a name="line.630"></a>
-<span class="sourceLineNo">631</span>     * @throws SQLException if a database access error occurs<a name="line.631"></a>
-<span class="sourceLineNo">632</span>     * @since 1.6<a name="line.632"></a>
-<span class="sourceLineNo">633</span>     */<a name="line.633"></a>
-<span class="sourceLineNo">634</span>    public &lt;T&gt; T insertBatch(String sql, ResultSetHandler&lt;T&gt; rsh, Object[][] params) throws SQLException {<a name="line.634"></a>
-<span class="sourceLineNo">635</span>        return insertBatch(this.prepareConnection(), true, sql, rsh, params);<a name="line.635"></a>
-<span class="sourceLineNo">636</span>    }<a name="line.636"></a>
-<span class="sourceLineNo">637</span><a name="line.637"></a>
-<span class="sourceLineNo">638</span>    /**<a name="line.638"></a>
-<span class="sourceLineNo">639</span>     * Executes the given batch of INSERT SQL statements.<a name="line.639"></a>
-<span class="sourceLineNo">640</span>     * @param &lt;T&gt; The type of object that the handler returns<a name="line.640"></a>
-<span class="sourceLineNo">641</span>     * @param conn The connection to use to run the query.<a name="line.641"></a>
-<span class="sourceLineNo">642</span>     * @param sql The SQL to execute.<a name="line.642"></a>
-<span class="sourceLineNo">643</span>     * @param rsh The handler used to create the result object from<a name="line.643"></a>
-<span class="sourceLineNo">644</span>     * the &lt;code&gt;ResultSet&lt;/code&gt; of auto-generated keys.<a name="line.644"></a>
-<span class="sourceLineNo">645</span>     * @param params The query replacement parameters.<a name="line.645"></a>
-<span class="sourceLineNo">646</span>     * @return The result generated by the handler.<a name="line.646"></a>
-<span class="sourceLineNo">647</span>     * @throws SQLException if a database access error occurs<a name="line.647"></a>
-<span class="sourceLineNo">648</span>     * @since 1.6<a name="line.648"></a>
-<span class="sourceLineNo">649</span>     */<a name="line.649"></a>
-<span class="sourceLineNo">650</span>    public &lt;T&gt; T insertBatch(Connection conn, String sql, ResultSetHandler&lt;T&gt; rsh, Object[][] params) throws SQLException {<a name="line.650"></a>
-<span class="sourceLineNo">651</span>        return insertBatch(conn, false, sql, rsh, params);<a name="line.651"></a>
-<span class="sourceLineNo">652</span>    }<a name="line.652"></a>
-<span class="sourceLineNo">653</span><a name="line.653"></a>
-<span class="sourceLineNo">654</span>    /**<a name="line.654"></a>
-<span class="sourceLineNo">655</span>     * Executes the given batch of INSERT SQL statements.<a name="line.655"></a>
-<span class="sourceLineNo">656</span>     * @param conn The connection to use for the query call.<a name="line.656"></a>
-<span class="sourceLineNo">657</span>     * @param closeConn True if the connection should be closed, false otherwise.<a name="line.657"></a>
-<span class="sourceLineNo">658</span>     * @param sql The SQL statement to execute.<a name="line.658"></a>
-<span class="sourceLineNo">659</span>     * @param rsh The handler used to create the result object from<a name="line.659"></a>
-<span class="sourceLineNo">660</span>     * the &lt;code&gt;ResultSet&lt;/code&gt; of auto-generated keys.<a name="line.660"></a>
-<span class="sourceLineNo">661</span>     * @param params The query replacement parameters.<a name="line.661"></a>
-<span class="sourceLineNo">662</span>     * @return The result generated by the handler.<a name="line.662"></a>
-<span class="sourceLineNo">663</span>     * @throws SQLException If there are database or parameter errors.<a name="line.663"></a>
-<span class="sourceLineNo">664</span>     * @since 1.6<a name="line.664"></a>
-<span class="sourceLineNo">665</span>     */<a name="line.665"></a>
-<span class="sourceLineNo">666</span>    private &lt;T&gt; T insertBatch(Connection conn, boolean closeConn, String sql, ResultSetHandler&lt;T&gt; rsh, Object[][] params) throws SQLException {<a name="line.666"></a>
-<span class="sourceLineNo">667</span>        if (conn == null) {<a name="line.667"></a>
-<span class="sourceLineNo">668</span>            throw new SQLException("Null connection");<a name="line.668"></a>
-<span class="sourceLineNo">669</span>        }<a name="line.669"></a>
-<span class="sourceLineNo">670</span><a name="line.670"></a>
-<span class="sourceLineNo">671</span>        if (sql == null) {<a name="line.671"></a>
-<span class="sourceLineNo">672</span>            if (closeConn) {<a name="line.672"></a>
-<span class="sourceLineNo">673</span>                close(conn);<a name="line.673"></a>
-<span class="sourceLineNo">674</span>            }<a name="line.674"></a>
-<span class="sourceLineNo">675</span>            throw new SQLException("Null SQL statement");<a name="line.675"></a>
-<span class="sourceLineNo">676</span>        }<a name="line.676"></a>
-<span class="sourceLineNo">677</span><a name="line.677"></a>
-<span class="sourceLineNo">678</span>        if (params == null) {<a name="line.678"></a>
-<span class="sourceLineNo">679</span>            if (closeConn) {<a name="line.679"></a>
-<span class="sourceLineNo">680</span>                close(conn);<a name="line.680"></a>
-<span class="sourceLineNo">681</span>            }<a name="line.681"></a>
-<span class="sourceLineNo">682</span>            throw new SQLException("Null parameters. If parameters aren't need, pass an empty array.");<a name="line.682"></a>
-<span class="sourceLineNo">683</span>        }<a name="line.683"></a>
-<span class="sourceLineNo">684</span><a name="line.684"></a>
-<span class="sourceLineNo">685</span>        PreparedStatement stmt = null;<a name="line.685"></a>
-<span class="sourceLineNo">686</span>        T generatedKeys = null;<a name="line.686"></a>
-<span class="sourceLineNo">687</span>        try {<a name="line.687"></a>
-<span class="sourceLineNo">688</span>            stmt = this.prepareStatement(conn, sql, Statement.RETURN_GENERATED_KEYS);<a name="line.688"></a>
-<span class="sourceLineNo">689</span><a name="line.689"></a>
-<span class="sourceLineNo">690</span>            for (int i = 0; i &lt; params.length; i++) {<a name="line.690"></a>
-<span class="sourceLineNo">691</span>                this.fillStatement(stmt, params[i]);<a name="line.691"></a>
-<span class="sourceLineNo">692</span>                stmt.addBatch();<a name="line.692"></a>
-<span class="sourceLineNo">693</span>            }<a name="line.693"></a>
-<span class="sourceLineNo">694</span>            stmt.executeBatch();<a name="line.694"></a>
-<span class="sourceLineNo">695</span>            ResultSet rs = stmt.getGeneratedKeys();<a name="line.695"></a>
-<span class="sourceLineNo">696</span>            generatedKeys = rsh.handle(rs);<a name="line.696"></a>
-<span class="sourceLineNo">697</span><a name="line.697"></a>
-<span class="sourceLineNo">698</span>        } catch (SQLException e) {<a name="line.698"></a>
-<span class="sourceLineNo">699</span>            this.rethrow(e, sql, (Object[])params);<a name="line.699"></a>
-<span class="sourceLineNo">700</span>        } finally {<a name="line.700"></a>
-<span class="sourceLineNo">701</span>            close(stmt);<a name="line.701"></a>
-<span class="sourceLineNo">702</span>            if (closeConn) {<a name="line.702"></a>
-<span class="sourceLineNo">703</span>                close(conn);<a name="line.703"></a>
-<span class="sourceLineNo">704</span>            }<a name="line.704"></a>
-<span class="sourceLineNo">705</span>        }<a name="line.705"></a>
-<span class="sourceLineNo">706</span><a name="line.706"></a>
-<span class="sourceLineNo">707</span>        return generatedKeys;<a name="line.707"></a>
-<span class="sourceLineNo">708</span>    }<a name="line.708"></a>
-<span class="sourceLineNo">709</span>}<a name="line.709"></a>
+<span class="sourceLineNo">580</span>    private &lt;T&gt; T insert(Connection conn, boolean closeConn, String sql, ResultSetHandler&lt;T&gt; rsh, Object... params)<a name="line.580"></a>
+<span class="sourceLineNo">581</span>            throws SQLException {<a name="line.581"></a>
+<span class="sourceLineNo">582</span>        if (conn == null) {<a name="line.582"></a>
+<span class="sourceLineNo">583</span>            throw new SQLException("Null connection");<a name="line.583"></a>
+<span class="sourceLineNo">584</span>        }<a name="line.584"></a>
+<span class="sourceLineNo">585</span><a name="line.585"></a>
+<span class="sourceLineNo">586</span>        if (sql == null) {<a name="line.586"></a>
+<span class="sourceLineNo">587</span>            if (closeConn) {<a name="line.587"></a>
+<span class="sourceLineNo">588</span>                close(conn);<a name="line.588"></a>
+<span class="sourceLineNo">589</span>            }<a name="line.589"></a>
+<span class="sourceLineNo">590</span>            throw new SQLException("Null SQL statement");<a name="line.590"></a>
+<span class="sourceLineNo">591</span>        }<a name="line.591"></a>
+<span class="sourceLineNo">592</span><a name="line.592"></a>
+<span class="sourceLineNo">593</span>        if (rsh == null) {<a name="line.593"></a>
+<span class="sourceLineNo">594</span>            if (closeConn) {<a name="line.594"></a>
+<span class="sourceLineNo">595</span>                close(conn);<a name="line.595"></a>
+<span class="sourceLineNo">596</span>            }<a name="line.596"></a>
+<span class="sourceLineNo">597</span>            throw new SQLException("Null ResultSetHandler");<a name="line.597"></a>
+<span class="sourceLineNo">598</span>        }<a name="line.598"></a>
+<span class="sourceLineNo">599</span><a name="line.599"></a>
+<span class="sourceLineNo">600</span>        PreparedStatement stmt = null;<a name="line.600"></a>
+<span class="sourceLineNo">601</span>        T generatedKeys = null;<a name="line.601"></a>
+<span class="sourceLineNo">602</span><a name="line.602"></a>
+<span class="sourceLineNo">603</span>        try {<a name="line.603"></a>
+<span class="sourceLineNo">604</span>            stmt = conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);<a name="line.604"></a>
+<span class="sourceLineNo">605</span>            this.fillStatement(stmt, params);<a name="line.605"></a>
+<span class="sourceLineNo">606</span>            stmt.executeUpdate();<a name="line.606"></a>
+<span class="sourceLineNo">607</span>            ResultSet resultSet = stmt.getGeneratedKeys();<a name="line.607"></a>
+<span class="sourceLineNo">608</span>            generatedKeys = rsh.handle(resultSet);<a name="line.608"></a>
+<span class="sourceLineNo">609</span>        } catch (SQLException e) {<a name="line.609"></a>
+<span class="sourceLineNo">610</span>            this.rethrow(e, sql, params);<a name="line.610"></a>
+<span class="sourceLineNo">611</span>        } finally {<a name="line.611"></a>
+<span class="sourceLineNo">612</span>            close(stmt);<a name="line.612"></a>
+<span class="sourceLineNo">613</span>            if (closeConn) {<a name="line.613"></a>
+<span class="sourceLineNo">614</span>                close(conn);<a name="line.614"></a>
+<span class="sourceLineNo">615</span>            }<a name="line.615"></a>
+<span class="sourceLineNo">616</span>        }<a name="line.616"></a>
+<span class="sourceLineNo">617</span><a name="line.617"></a>
+<span class="sourceLineNo">618</span>        return generatedKeys;<a name="line.618"></a>
+<span class="sourceLineNo">619</span>    }<a name="line.619"></a>
+<span class="sourceLineNo">620</span><a name="line.620"></a>
+<span class="sourceLineNo">621</span>    /**<a name="line.621"></a>
+<span class="sourceLineNo">622</span>     * Executes the given batch of INSERT SQL statements. The<a name="line.622"></a>
+<span class="sourceLineNo">623</span>     * &lt;code&gt;Connection&lt;/code&gt; is retrieved from the &lt;code&gt;DataSource&lt;/code&gt;<a name="line.623"></a>
+<span class="sourceLineNo">624</span>     * set in the constructor.  This &lt;code&gt;Connection&lt;/code&gt; must be in<a name="line.624"></a>
+<span class="sourceLineNo">625</span>     * auto-commit mode or the insert will not be saved.<a name="line.625"></a>
+<span class="sourceLineNo">626</span>     * @param &lt;T&gt; The type of object that the handler returns<a name="line.626"></a>
+<span class="sourceLineNo">627</span>     * @param sql The SQL statement to execute.<a name="line.627"></a>
+<span class="sourceLineNo">628</span>     * @param rsh The handler used to create the result object from<a name="line.628"></a>
+<span class="sourceLineNo">629</span>     * the &lt;code&gt;ResultSet&lt;/code&gt; of auto-generated keys.<a name="line.629"></a>
+<span class="sourceLineNo">630</span>     * @param params Initializes the PreparedStatement's IN (i.e. '?')<a name="line.630"></a>
+<span class="sourceLineNo">631</span>     * @return The result generated by the handler.<a name="line.631"></a>
+<span class="sourceLineNo">632</span>     * @throws SQLException if a database access error occurs<a name="line.632"></a>
+<span class="sourceLineNo">633</span>     * @since 1.6<a name="line.633"></a>
+<span class="sourceLineNo">634</span>     */<a name="line.634"></a>
+<span class="sourceLineNo">635</span>    public &lt;T&gt; T insertBatch(String sql, ResultSetHandler&lt;T&gt; rsh, Object[][] params) throws SQLException {<a name="line.635"></a>
+<span class="sourceLineNo">636</span>        return insertBatch(this.prepareConnection(), true, sql, rsh, params);<a name="line.636"></a>
+<span class="sourceLineNo">637</span>    }<a name="line.637"></a>
+<span class="sourceLineNo">638</span><a name="line.638"></a>
+<span class="sourceLineNo">639</span>    /**<a name="line.639"></a>
+<span class="sourceLineNo">640</span>     * Executes the given batch of INSERT SQL statements.<a name="line.640"></a>
+<span class="sourceLineNo">641</span>     * @param &lt;T&gt; The type of object that the handler returns<a name="line.641"></a>
+<span class="sourceLineNo">642</span>     * @param conn The connection to use to run the query.<a name="line.642"></a>
+<span class="sourceLineNo">643</span>     * @param sql The SQL to execute.<a name="line.643"></a>
+<span class="sourceLineNo">644</span>     * @param rsh The handler used to create the result object from<a name="line.644"></a>
+<span class="sourceLineNo">645</span>     * the &lt;code&gt;ResultSet&lt;/code&gt; of auto-generated keys.<a name="line.645"></a>
+<span class="sourceLineNo">646</span>     * @param params The query replacement parameters.<a name="line.646"></a>
+<span class="sourceLineNo">647</span>     * @return The result generated by the handler.<a name="line.647"></a>
+<span class="sourceLineNo">648</span>     * @throws SQLException if a database access error occurs<a name="line.648"></a>
+<span class="sourceLineNo">649</span>     * @since 1.6<a name="line.649"></a>
+<span class="sourceLineNo">650</span>     */<a name="line.650"></a>
+<span class="sourceLineNo">651</span>    public &lt;T&gt; T insertBatch(Connection conn, String sql, ResultSetHandler&lt;T&gt; rsh, Object[][] params) throws SQLException {<a name="line.651"></a>
+<span class="sourceLineNo">652</span>        return insertBatch(conn, false, sql, rsh, params);<a name="line.652"></a>
+<span class="sourceLineNo">653</span>    }<a name="line.653"></a>
+<span class="sourceLineNo">654</span><a name="line.654"></a>
+<span class="sourceLineNo">655</span>    /**<a name="line.655"></a>
+<span class="sourceLineNo">656</span>     * Executes the given batch of INSERT SQL statements.<a name="line.656"></a>
+<span class="sourceLineNo">657</span>     * @param conn The connection to use for the query call.<a name="line.657"></a>
+<span class="sourceLineNo">658</span>     * @param closeConn True if the connection should be closed, false otherwise.<a name="line.658"></a>
+<span class="sourceLineNo">659</span>     * @param sql The SQL statement to execute.<a name="line.659"></a>
+<span class="sourceLineNo">660</span>     * @param rsh The handler used to create the result object from<a name="line.660"></a>
+<span class="sourceLineNo">661</span>     * the &lt;code&gt;ResultSet&lt;/code&gt; of auto-generated keys.<a name="line.661"></a>
+<span class="sourceLineNo">662</span>     * @param params The query replacement parameters.<a name="line.662"></a>
+<span class="sourceLineNo">663</span>     * @return The result generated by the handler.<a name="line.663"></a>
+<span class="sourceLineNo">664</span>     * @throws SQLException If there are database or parameter errors.<a name="line.664"></a>
+<span class="sourceLineNo">665</span>     * @since 1.6<a name="line.665"></a>
+<span class="sourceLineNo">666</span>     */<a name="line.666"></a>
+<span class="sourceLineNo">667</span>    private &lt;T&gt; T insertBatch(Connection conn, boolean closeConn, String sql, ResultSetHandler&lt;T&gt; rsh, Object[][] params)<a name="line.667"></a>
+<span class="sourceLineNo">668</span>            throws SQLException {<a name="line.668"></a>
+<span class="sourceLineNo">669</span>        if (conn == null) {<a name="line.669"></a>
+<span class="sourceLineNo">670</span>            throw new SQLException("Null connection");<a name="line.670"></a>
+<span class="sourceLineNo">671</span>        }<a name="line.671"></a>
+<span class="sourceLineNo">672</span><a name="line.672"></a>
+<span class="sourceLineNo">673</span>        if (sql == null) {<a name="line.673"></a>
+<span class="sourceLineNo">674</span>            if (closeConn) {<a name="line.674"></a>
+<span class="sourceLineNo">675</span>                close(conn);<a name="line.675"></a>
+<span class="sourceLineNo">676</span>            }<a name="line.676"></a>
+<span class="sourceLineNo">677</span>            throw new SQLException("Null SQL statement");<a name="line.677"></a>
+<span class="sourceLineNo">678</span>        }<a name="line.678"></a>
+<span class="sourceLineNo">679</span><a name="line.679"></a>
+<span class="sourceLineNo">680</span>        if (params == null) {<a name="line.680"></a>
+<span class="sourceLineNo">681</span>            if (closeConn) {<a name="line.681"></a>
+<span class="sourceLineNo">682</span>                close(conn);<a name="line.682"></a>
+<span class="sourceLineNo">683</span>            }<a name="line.683"></a>
+<span class="sourceLineNo">684</span>            throw new SQLException("Null parameters. If parameters aren't need, pass an empty array.");<a name="line.684"></a>
+<span class="sourceLineNo">685</span>        }<a name="line.685"></a>
+<span class="sourceLineNo">686</span><a name="line.686"></a>
+<span class="sourceLineNo">687</span>        PreparedStatement stmt = null;<a name="line.687"></a>
+<span class="sourceLineNo">688</span>        T generatedKeys = null;<a name="line.688"></a>
+<span class="sourceLineNo">689</span>        try {<a name="line.689"></a>
+<span class="sourceLineNo">690</span>            stmt = this.prepareStatement(conn, sql, Statement.RETURN_GENERATED_KEYS);<a name="line.690"></a>
+<span class="sourceLineNo">691</span><a name="line.691"></a>
+<span class="sourceLineNo">692</span>            for (int i = 0; i &lt; params.length; i++) {<a name="line.692"></a>
+<span class="sourceLineNo">693</span>                this.fillStatement(stmt, params[i]);<a name="line.693"></a>
+<span class="sourceLineNo">694</span>                stmt.addBatch();<a name="line.694"></a>
+<span class="sourceLineNo">695</span>            }<a name="line.695"></a>
+<span class="sourceLineNo">696</span>            stmt.executeBatch();<a name="line.696"></a>
+<span class="sourceLineNo">697</span>            ResultSet rs = stmt.getGeneratedKeys();<a name="line.697"></a>
+<span class="sourceLineNo">698</span>            generatedKeys = rsh.handle(rs);<a name="line.698"></a>
+<span class="sourceLineNo">699</span><a name="line.699"></a>
+<span class="sourceLineNo">700</span>        } catch (SQLException e) {<a name="line.700"></a>
+<span class="sourceLineNo">701</span>            this.rethrow(e, sql, (Object[])params);<a name="line.701"></a>
+<span class="sourceLineNo">702</span>        } finally {<a name="line.702"></a>
+<span class="sourceLineNo">703</span>            close(stmt);<a name="line.703"></a>
+<span class="sourceLineNo">704</span>            if (closeConn) {<a name="line.704"></a>
+<span class="sourceLineNo">705</span>                close(conn);<a name="line.705"></a>
+<span class="sourceLineNo">706</span>            }<a name="line.706"></a>
+<span class="sourceLineNo">707</span>        }<a name="line.707"></a>
+<span class="sourceLineNo">708</span><a name="line.708"></a>
+<span class="sourceLineNo">709</span>        return generatedKeys;<a name="line.709"></a>
+<span class="sourceLineNo">710</span>    }<a name="line.710"></a>
+<span class="sourceLineNo">711</span>}<a name="line.711"></a>
 
 
 

Modified: websites/production/commons/content/proper/commons-dbutils/apidocs/src-html/org/apache/commons/dbutils/handlers/ArrayHandler.html
==============================================================================
--- websites/production/commons/content/proper/commons-dbutils/apidocs/src-html/org/apache/commons/dbutils/handlers/ArrayHandler.html (original)
+++ websites/production/commons/content/proper/commons-dbutils/apidocs/src-html/org/apache/commons/dbutils/handlers/ArrayHandler.html Sun Jul 20 08:52:20 2014
@@ -48,45 +48,50 @@
 <span class="sourceLineNo">040</span>    static final RowProcessor ROW_PROCESSOR = new BasicRowProcessor();<a name="line.40"></a>
 <span class="sourceLineNo">041</span><a name="line.41"></a>
 <span class="sourceLineNo">042</span>    /**<a name="line.42"></a>
-<span class="sourceLineNo">043</span>     * The RowProcessor implementation to use when converting rows<a name="line.43"></a>
-<span class="sourceLineNo">044</span>     * into arrays.<a name="line.44"></a>
-<span class="sourceLineNo">045</span>     */<a name="line.45"></a>
-<span class="sourceLineNo">046</span>    private final RowProcessor convert;<a name="line.46"></a>
-<span class="sourceLineNo">047</span><a name="line.47"></a>
-<span class="sourceLineNo">048</span>    /**<a name="line.48"></a>
-<span class="sourceLineNo">049</span>     * Creates a new instance of ArrayHandler using a<a name="line.49"></a>
-<span class="sourceLineNo">050</span>     * &lt;code&gt;BasicRowProcessor&lt;/code&gt; for conversion.<a name="line.50"></a>
-<span class="sourceLineNo">051</span>     */<a name="line.51"></a>
-<span class="sourceLineNo">052</span>    public ArrayHandler() {<a name="line.52"></a>
-<span class="sourceLineNo">053</span>        this(ROW_PROCESSOR);<a name="line.53"></a>
-<span class="sourceLineNo">054</span>    }<a name="line.54"></a>
-<span class="sourceLineNo">055</span><a name="line.55"></a>
-<span class="sourceLineNo">056</span>    /**<a name="line.56"></a>
-<span class="sourceLineNo">057</span>     * Creates a new instance of ArrayHandler.<a name="line.57"></a>
-<span class="sourceLineNo">058</span>     *<a name="line.58"></a>
-<span class="sourceLineNo">059</span>     * @param convert The &lt;code&gt;RowProcessor&lt;/code&gt; implementation<a name="line.59"></a>
-<span class="sourceLineNo">060</span>     * to use when converting rows into arrays.<a name="line.60"></a>
-<span class="sourceLineNo">061</span>     */<a name="line.61"></a>
-<span class="sourceLineNo">062</span>    public ArrayHandler(RowProcessor convert) {<a name="line.62"></a>
-<span class="sourceLineNo">063</span>        super();<a name="line.63"></a>
-<span class="sourceLineNo">064</span>        this.convert = convert;<a name="line.64"></a>
-<span class="sourceLineNo">065</span>    }<a name="line.65"></a>
-<span class="sourceLineNo">066</span><a name="line.66"></a>
-<span class="sourceLineNo">067</span>    /**<a name="line.67"></a>
-<span class="sourceLineNo">068</span>     * Places the column values from the first row in an &lt;code&gt;Object[]&lt;/code&gt;.<a name="line.68"></a>
-<span class="sourceLineNo">069</span>     * @param rs &lt;code&gt;ResultSet&lt;/code&gt; to process.<a name="line.69"></a>
-<span class="sourceLineNo">070</span>     * @return An Object[] or &lt;code&gt;null&lt;/code&gt; if there are no rows in the<a name="line.70"></a>
-<span class="sourceLineNo">071</span>     * &lt;code&gt;ResultSet&lt;/code&gt;.<a name="line.71"></a>
-<span class="sourceLineNo">072</span>     *<a name="line.72"></a>
-<span class="sourceLineNo">073</span>     * @throws SQLException if a database access error occurs<a name="line.73"></a>
-<span class="sourceLineNo">074</span>     * @see org.apache.commons.dbutils.ResultSetHandler#handle(java.sql.ResultSet)<a name="line.74"></a>
-<span class="sourceLineNo">075</span>     */<a name="line.75"></a>
-<span class="sourceLineNo">076</span>    @Override<a name="line.76"></a>
-<span class="sourceLineNo">077</span>    public Object[] handle(ResultSet rs) throws SQLException {<a name="line.77"></a>
-<span class="sourceLineNo">078</span>        return rs.next() ? this.convert.toArray(rs) : null;<a name="line.78"></a>
-<span class="sourceLineNo">079</span>    }<a name="line.79"></a>
-<span class="sourceLineNo">080</span><a name="line.80"></a>
-<span class="sourceLineNo">081</span>}<a name="line.81"></a>
+<span class="sourceLineNo">043</span>     * An empty array to return when no more rows are available in the ResultSet.<a name="line.43"></a>
+<span class="sourceLineNo">044</span>     */<a name="line.44"></a>
+<span class="sourceLineNo">045</span>    private static final Object[] EMPTY_ARRAY = new Object[0];<a name="line.45"></a>
+<span class="sourceLineNo">046</span><a name="line.46"></a>
+<span class="sourceLineNo">047</span>    /**<a name="line.47"></a>
+<span class="sourceLineNo">048</span>     * The RowProcessor implementation to use when converting rows<a name="line.48"></a>
+<span class="sourceLineNo">049</span>     * into arrays.<a name="line.49"></a>
+<span class="sourceLineNo">050</span>     */<a name="line.50"></a>
+<span class="sourceLineNo">051</span>    private final RowProcessor convert;<a name="line.51"></a>
+<span class="sourceLineNo">052</span><a name="line.52"></a>
+<span class="sourceLineNo">053</span>    /**<a name="line.53"></a>
+<span class="sourceLineNo">054</span>     * Creates a new instance of ArrayHandler using a<a name="line.54"></a>
+<span class="sourceLineNo">055</span>     * &lt;code&gt;BasicRowProcessor&lt;/code&gt; for conversion.<a name="line.55"></a>
+<span class="sourceLineNo">056</span>     */<a name="line.56"></a>
+<span class="sourceLineNo">057</span>    public ArrayHandler() {<a name="line.57"></a>
+<span class="sourceLineNo">058</span>        this(ROW_PROCESSOR);<a name="line.58"></a>
+<span class="sourceLineNo">059</span>    }<a name="line.59"></a>
+<span class="sourceLineNo">060</span><a name="line.60"></a>
+<span class="sourceLineNo">061</span>    /**<a name="line.61"></a>
+<span class="sourceLineNo">062</span>     * Creates a new instance of ArrayHandler.<a name="line.62"></a>
+<span class="sourceLineNo">063</span>     *<a name="line.63"></a>
+<span class="sourceLineNo">064</span>     * @param convert The &lt;code&gt;RowProcessor&lt;/code&gt; implementation<a name="line.64"></a>
+<span class="sourceLineNo">065</span>     * to use when converting rows into arrays.<a name="line.65"></a>
+<span class="sourceLineNo">066</span>     */<a name="line.66"></a>
+<span class="sourceLineNo">067</span>    public ArrayHandler(RowProcessor convert) {<a name="line.67"></a>
+<span class="sourceLineNo">068</span>        super();<a name="line.68"></a>
+<span class="sourceLineNo">069</span>        this.convert = convert;<a name="line.69"></a>
+<span class="sourceLineNo">070</span>    }<a name="line.70"></a>
+<span class="sourceLineNo">071</span><a name="line.71"></a>
+<span class="sourceLineNo">072</span>    /**<a name="line.72"></a>
+<span class="sourceLineNo">073</span>     * Places the column values from the first row in an &lt;code&gt;Object[]&lt;/code&gt;.<a name="line.73"></a>
+<span class="sourceLineNo">074</span>     * @param rs &lt;code&gt;ResultSet&lt;/code&gt; to process.<a name="line.74"></a>
+<span class="sourceLineNo">075</span>     * @return An Object[]. If there are no rows in the &lt;code&gt;ResultSet&lt;/code&gt;<a name="line.75"></a>
+<span class="sourceLineNo">076</span>     * an empty array will be returned.<a name="line.76"></a>
+<span class="sourceLineNo">077</span>     *<a name="line.77"></a>
+<span class="sourceLineNo">078</span>     * @throws SQLException if a database access error occurs<a name="line.78"></a>
+<span class="sourceLineNo">079</span>     * @see org.apache.commons.dbutils.ResultSetHandler#handle(java.sql.ResultSet)<a name="line.79"></a>
+<span class="sourceLineNo">080</span>     */<a name="line.80"></a>
+<span class="sourceLineNo">081</span>    @Override<a name="line.81"></a>
+<span class="sourceLineNo">082</span>    public Object[] handle(ResultSet rs) throws SQLException {<a name="line.82"></a>
+<span class="sourceLineNo">083</span>        return rs.next() ? this.convert.toArray(rs) : EMPTY_ARRAY;<a name="line.83"></a>
+<span class="sourceLineNo">084</span>    }<a name="line.84"></a>
+<span class="sourceLineNo">085</span><a name="line.85"></a>
+<span class="sourceLineNo">086</span>}<a name="line.86"></a>
 
 
 

Modified: websites/production/commons/content/proper/commons-dbutils/apidocs/src-html/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSet.html
==============================================================================
--- websites/production/commons/content/proper/commons-dbutils/apidocs/src-html/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSet.html (original)
+++ websites/production/commons/content/proper/commons-dbutils/apidocs/src-html/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSet.html Sun Jul 20 08:52:20 2014
@@ -261,7 +261,7 @@
 <span class="sourceLineNo">253</span>     * @return the value<a name="line.253"></a>
 <span class="sourceLineNo">254</span>     */<a name="line.254"></a>
 <span class="sourceLineNo">255</span>    public Date getNullDate() {<a name="line.255"></a>
-<span class="sourceLineNo">256</span>        return this.nullDate;<a name="line.256"></a>
+<span class="sourceLineNo">256</span>        return this.nullDate != null ? new Date(this.nullDate.getTime()) : null;<a name="line.256"></a>
 <span class="sourceLineNo">257</span>    }<a name="line.257"></a>
 <span class="sourceLineNo">258</span><a name="line.258"></a>
 <span class="sourceLineNo">259</span>    /**<a name="line.259"></a>
@@ -361,7 +361,7 @@
 <span class="sourceLineNo">353</span>     * @return the value<a name="line.353"></a>
 <span class="sourceLineNo">354</span>     */<a name="line.354"></a>
 <span class="sourceLineNo">355</span>    public Timestamp getNullTimestamp() {<a name="line.355"></a>
-<span class="sourceLineNo">356</span>        return this.nullTimestamp;<a name="line.356"></a>
+<span class="sourceLineNo">356</span>        return this.nullTimestamp != null ? new Timestamp(this.nullTimestamp.getTime()) : null;<a name="line.356"></a>
 <span class="sourceLineNo">357</span>    }<a name="line.357"></a>
 <span class="sourceLineNo">358</span><a name="line.358"></a>
 <span class="sourceLineNo">359</span>    /**<a name="line.359"></a>
@@ -500,7 +500,7 @@
 <span class="sourceLineNo">492</span>     * @param nullDate the value<a name="line.492"></a>
 <span class="sourceLineNo">493</span>     */<a name="line.493"></a>
 <span class="sourceLineNo">494</span>    public void setNullDate(Date nullDate) {<a name="line.494"></a>
-<span class="sourceLineNo">495</span>        this.nullDate = nullDate;<a name="line.495"></a>
+<span class="sourceLineNo">495</span>        this.nullDate = nullDate != null ? new Date(nullDate.getTime()) : null;<a name="line.495"></a>
 <span class="sourceLineNo">496</span>    }<a name="line.496"></a>
 <span class="sourceLineNo">497</span><a name="line.497"></a>
 <span class="sourceLineNo">498</span>    /**<a name="line.498"></a>
@@ -600,7 +600,7 @@
 <span class="sourceLineNo">592</span>     * @param nullTimestamp the value<a name="line.592"></a>
 <span class="sourceLineNo">593</span>     */<a name="line.593"></a>
 <span class="sourceLineNo">594</span>    public void setNullTimestamp(Timestamp nullTimestamp) {<a name="line.594"></a>
-<span class="sourceLineNo">595</span>        this.nullTimestamp = nullTimestamp;<a name="line.595"></a>
+<span class="sourceLineNo">595</span>        this.nullTimestamp = nullTimestamp != null ? new Timestamp(nullTimestamp.getTime()) : null;<a name="line.595"></a>
 <span class="sourceLineNo">596</span>    }<a name="line.596"></a>
 <span class="sourceLineNo">597</span><a name="line.597"></a>
 <span class="sourceLineNo">598</span>    /**<a name="line.598"></a>

Modified: websites/production/commons/content/proper/commons-dbutils/building.html
==============================================================================
--- websites/production/commons/content/proper/commons-dbutils/building.html (original)
+++ websites/production/commons/content/proper/commons-dbutils/building.html Sun Jul 20 08:52:20 2014
@@ -1,6 +1,6 @@
 <!DOCTYPE html>
 <!--
- | Generated by Apache Maven Doxia at 27 February 2014
+ | Generated by Apache Maven Doxia at 20 July 2014
  | Rendered using Apache Maven Fluido Skin 1.3.0
 -->
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
@@ -8,7 +8,7 @@
     <meta charset="iso-8859-1" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
     <meta name="author" content="Commons Documentation Team" />
-    <meta name="Date-Revision-yyyymmdd" content="20140227" />
+    <meta name="Date-Revision-yyyymmdd" content="20140720" />
     <meta http-equiv="Content-Language" content="en" />
     <title>DbUtils - 
   Building</title>
@@ -45,8 +45,8 @@
 					<a class="brand" href="http://commons.apache.org/proper/commons-dbutils/">Apache Commons DbUtils &trade;</a>
 					<ul class="nav">      
                     
-            <li id="publishDate">Last Published: 27 February 2014</li>
-      <li class="divider">|</li> <li id="projectVersion">Version: 1.6-SNAPSHOT</li>
+            <li id="publishDate">Last Published: 20 July 2014</li>
+      <li class="divider">|</li> <li id="projectVersion">Version: 1.6</li>
   </ul>
                     <div class="pull-right">	<ul class="nav">
 						<li>
@@ -128,7 +128,7 @@
 		              <a href="project-info.html" title="Project Information">
     Project Information</a>
   									</li>
- 																		                                                                                                                                                                                                                                                                                                        								<li class="collapsed">
+ 																		                                                                                                                                                                                                                                                                    								<li class="collapsed">
 		              <a href="project-reports.html" title="Project Reports">
     Project Reports</a>
   									</li>

Modified: websites/production/commons/content/proper/commons-dbutils/changes-report.html
==============================================================================
--- websites/production/commons/content/proper/commons-dbutils/changes-report.html (original)
+++ websites/production/commons/content/proper/commons-dbutils/changes-report.html Sun Jul 20 08:52:20 2014
@@ -1,13 +1,13 @@
 <!DOCTYPE html>
 <!--
- | Generated by Apache Maven Doxia at 27 February 2014
+ | Generated by Apache Maven Doxia at 20 July 2014
  | Rendered using Apache Maven Fluido Skin 1.3.0
 -->
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
   <head>
     <meta charset="iso-8859-1" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <meta name="Date-Revision-yyyymmdd" content="20140227" />
+    <meta name="Date-Revision-yyyymmdd" content="20140720" />
     <meta http-equiv="Content-Language" content="en" />
     <title>DbUtils - Release Notes</title>
 
@@ -43,8 +43,8 @@
 					<a class="brand" href="http://commons.apache.org/proper/commons-dbutils/">Apache Commons DbUtils &trade;</a>
 					<ul class="nav">      
                     
-            <li id="publishDate">Last Published: 27 February 2014</li>
-      <li class="divider">|</li> <li id="projectVersion">Version: 1.6-SNAPSHOT</li>
+            <li id="publishDate">Last Published: 20 July 2014</li>
+      <li class="divider">|</li> <li id="projectVersion">Version: 1.6</li>
   </ul>
                     <div class="pull-right">	<ul class="nav">
 						<li>
@@ -126,7 +126,7 @@
 		              <a href="project-info.html" title="Project Information">
     Project Information</a>
   									</li>
- 																		                                                                                                                                                                                                                                                                                                              										<li class="expanded">
+ 																		                                                                                                                                                                                                                                                                          										<li class="expanded">
 		              <a href="project-reports.html" title="Project Reports">
     Project Reports</a>
   									<ul>
@@ -171,6 +171,10 @@
     JDepend</a>
   				</li>
  																		<li class="none">
+		              <a href="cobertura/index.html" title="Cobertura Test Coverage">
+    Cobertura Test Coverage</a>
+  				</li>
+ 																		<li class="none">
 		              <a href="checkstyle-aggregate.html" title="Checkstyle">
     Checkstyle</a>
   				</li>
@@ -182,18 +186,6 @@
 		              <a href="findbugs.html" title="FindBugs Report">
     FindBugs Report</a>
   				</li>
- 																		<li class="none">
-		              <a href="cobertura/index.html" title="Cobertura Test Coverage">
-    Cobertura Test Coverage</a>
-  				</li>
- 																		<li class="none">
-		              <a href="pmd.html" title="PMD Report">
-    PMD Report</a>
-  				</li>
- 																		<li class="none">
-		              <a href="cpd.html" title="CPD Report">
-    CPD Report</a>
-  				</li>
  										</ul>
 							</li>
  								</ul>
@@ -288,7 +280,7 @@
 <th>Description</th></tr>
 <tr class="b">
 <td><a href="#a1.6">1.6</a></td>
-<td>TBA</td>
+<td>2014-07-20</td>
 <td>Bugfixes and addition of insert methods</td></tr>
 <tr class="a">
 <td><a href="#a1.5">1.5</a></td>
@@ -315,13 +307,29 @@
 <td>2003-11-10</td>
 <td>First release of DbUtils</td></tr></table></div>
 <div class="section">
-<h3>Release 1.6 - TBA<a name="Release_1.6_-_TBA"></a></h3><a name="a1.6"></a>
+<h3>Release 1.6 - 2014-07-20<a name="Release_1.6_-_2014-07-20"></a></h3><a name="a1.6"></a>
 <table border="0" class="bodyTable">
 <tr class="a">
 <th>Type</th>
 <th>Changes</th>
 <th>By</th></tr>
 <tr class="b">
+<td><img src="images/fix.gif" alt="fix" title="fix" /></td>
+<td>ArrayHandler should return an empty array when handle has no rows Fixes <a class="externalLink" href="http://issues.apache.org/jira/browse/DBUTILS-110">DBUTILS-110</a>.</td>
+<td><a href="team-list.html#britter">britter</a></td></tr>
+<tr class="a">
+<td><img src="images/fix.gif" alt="fix" title="fix" /></td>
+<td>Order of columns not retained in BasicRowProcessor with HashMap Fixes <a class="externalLink" href="http://issues.apache.org/jira/browse/DBUTILS-114">DBUTILS-114</a>. Thanks to Michael Osipov.</td>
+<td><a href="team-list.html#britter">britter</a></td></tr>
+<tr class="b">
+<td><img src="images/fix.gif" alt="fix" title="fix" /></td>
+<td>BeanProcessor not returning nanoseconds Fixes <a class="externalLink" href="http://issues.apache.org/jira/browse/DBUTILS-118">DBUTILS-118</a>. Thanks to Feysal Rujbally, Daniele Cremonini.</td>
+<td><a href="team-list.html#britter">britter</a></td></tr>
+<tr class="a">
+<td><img src="images/add.gif" alt="add" title="add" /></td>
+<td>Add support for conversion of ResultSet strings to enums in the BeanProcessor Fixes <a class="externalLink" href="http://issues.apache.org/jira/browse/DBUTILS-113">DBUTILS-113</a>. Thanks to Graylin Kim, Michael Osipov.</td>
+<td><a href="team-list.html#britter">britter</a></td></tr>
+<tr class="b">
 <td><img src="images/update.gif" alt="update" title="update" /></td>
 <td>In BeanProcessor#isCompatibleType, can Integer.class.isInstance(value) be replaced by value instanceof Integer (etc)?
         Simplified code by using instanceof. Fixes <a class="externalLink" href="http://issues.apache.org/jira/browse/DBUTILS-85">DBUTILS-85</a>.</td>



Mime
View raw message