On 21 September 2012 14:59,  <simonetrip...@apache.org> wrote:
> Author: simonetripodi
> Date: Fri Sep 21 13:59:46 2012
> New Revision: 1388495
>
> URL: http://svn.apache.org/viewvc?rev=1388495&view=rev
> Log:
> [DBUTILS-97] Add an Abstract ResultSetHandler implementation in order to 
> reduce redundant 'resultSet' variable invocation
>
> Added:
>     
> commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/BaseResultSetHandler.java
>    (with props)
>     
> commons/proper/dbutils/trunk/src/test/java/org/apache/commons/dbutils/BaseResultSetHandlerTestCase.java
>    (with props)
> Modified:
>     commons/proper/dbutils/trunk/src/changes/changes.xml
>
> Modified: commons/proper/dbutils/trunk/src/changes/changes.xml
> URL: 
> http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/changes/changes.xml?rev=1388495&r1=1388494&r2=1388495&view=diff
> ==============================================================================
> --- commons/proper/dbutils/trunk/src/changes/changes.xml (original)
> +++ commons/proper/dbutils/trunk/src/changes/changes.xml Fri Sep 21 13:59:46 
> 2012
> @@ -47,6 +47,9 @@ The <action> type attribute can be add,u
>        <action dev="simonetripodi" due-to="Moandji Ezana" type="add" 
> issue="DBUTILS-98">
>          Add missing JavaDoc to QueryRunner#insert
>        </action>
> +      <action dev="simonetripodi" type="add" issue="DBUTILS-97">
> +        Add an Abstract ResultSetHandler implementation in order to reduce 
> redundant 'resultSet' variable invocation
> +      </action>
>        <action dev="wspeirs" due-to="Moandji Ezana" type="add" 
> issue="DBUTILS-87">
>          Added insert methods to QueryRunner and AsyncQueryRunner that return 
> the generated key.
>        </action>
>
> Added: 
> commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/BaseResultSetHandler.java
> URL: 
> http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/BaseResultSetHandler.java?rev=1388495&view=auto
> ==============================================================================
> --- 
> commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/BaseResultSetHandler.java
>  (added)
> +++ 
> commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/BaseResultSetHandler.java
>  Fri Sep 21 13:59:46 2012
> @@ -0,0 +1,1969 @@
> +/*
> + * Licensed to the Apache Software Foundation (ASF) under one or more
> + * contributor license agreements.  See the NOTICE file distributed with
> + * this work for additional information regarding copyright ownership.
> + * The ASF licenses this file to You under the Apache License, Version 2.0
> + * (the "License"); you may not use this file except in compliance with
> + * the License.  You may obtain a copy of the License at
> + *
> + *      http://www.apache.org/licenses/LICENSE-2.0
> + *
> + * Unless required by applicable law or agreed to in writing, software
> + * distributed under the License is distributed on an "AS IS" BASIS,
> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> + * See the License for the specific language governing permissions and
> + * limitations under the License.
> + */
> +package org.apache.commons.dbutils;
> +
> +import java.io.InputStream;
> +import java.io.Reader;
> +import java.math.BigDecimal;
> +import java.net.URL;
> +import java.sql.Array;
> +import java.sql.Blob;
> +import java.sql.Clob;
> +import java.sql.Date;
> +import java.sql.NClob;
> +import java.sql.Ref;
> +import java.sql.ResultSet;
> +import java.sql.ResultSetMetaData;
> +import java.sql.RowId;
> +import java.sql.SQLException;
> +import java.sql.SQLWarning;
> +import java.sql.SQLXML;
> +import java.sql.Statement;
> +import java.sql.Time;
> +import java.sql.Timestamp;
> +import java.util.Calendar;
> +import java.util.Map;
> +
> +/**
> + * Extensions of this class convert ResultSets into other objects.
> + *
> + * According to the <i>DRY</i> principle (Don't Repeat Yourself), repeating 
> <code>resultSet</code>
> + * variable inside the {@link ResultSetHandler#handle(ResultSet)} over and 
> over for each iteration
> + * can get a little tedious, <code>AbstractResultSetHandler</code> 
> implicitly gives users access to
> + * <code>ResultSet</code>'s methods.
> + *

There should be some samples of how to use the class, as it's not
immediately obvious.

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

Reply via email to