Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * 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;
RowProcessor implementations convert ResultSet rows into various other objects. Implementations can extend BasicRowProcessor to protect themselves from changes to this interface.

public interface RowProcessor {

    
Create an Object[] from the column values in one ResultSet row. The ResultSet should be positioned on a valid row before passing it to this method. Implementations of this method must not alter the row position of the ResultSet.

Parameters:
rs ResultSet that supplies the array data
Returns:
the newly created array
Throws:
java.sql.SQLException if a database access error occurs
    Object[] toArray(ResultSet rsthrows SQLException;

    
Create a JavaBean from the column values in one ResultSet row. The ResultSet should be positioned on a valid row before passing it to this method. Implementations of this method must not alter the row position of the ResultSet.

Parameters:
<T> The type of bean to create
rs ResultSet that supplies the bean data
type Class from which to create the bean instance
Returns:
the newly created bean
Throws:
java.sql.SQLException if a database access error occurs
    <T> T toBean(ResultSet rsClass<T> typethrows SQLException;

    
Create a List of JavaBeans from the column values in all ResultSet rows. ResultSet.next() should not be called before passing it to this method.

Parameters:
<T> The type of bean to create
rs ResultSet that supplies the bean data
type Class from which to create the bean instance
Returns:
A List of beans with the given type in the order they were returned by the ResultSet.
Throws:
java.sql.SQLException if a database access error occurs
    <T> List<T> toBeanList(ResultSet rsClass<T> typethrows SQLException;

    
Create a Map from the column values in one ResultSet row. The ResultSet should be positioned on a valid row before passing it to this method. Implementations of this method must not alter the row position of the ResultSet.

Parameters:
rs ResultSet that supplies the map data
Returns:
the newly created Map
Throws:
java.sql.SQLException if a database access error occurs
    Map<StringObjecttoMap(ResultSet rsthrows SQLException;
New to GrepCode? Check out our FAQ X