com.onewebsql.util.jdbc
Class ArrayRowHandler<T>

java.lang.Object
  extended by com.onewebsql.util.jdbc.ArrayRowHandler<T>
Type Parameters:
T - type of objects in the array
All Implemented Interfaces:
RowHandler<T[]>

public class ArrayRowHandler<T>
extends Object
implements RowHandler<T[]>

Implementation of the interface RowHandler which converts the specified row into an array of objects of type T.


Constructor Summary
ArrayRowHandler()
          Constructor, creates a new ArrayRowHandler object which returns arrays of type Object[].
ArrayRowHandler(Class<T[]> clazz)
          Constructor, creates a new ArrayRowHandler object which generates arrays of the given class.
 
Method Summary
 T[] getObject(ResultSet resultSet)
          Converts the specified ResultSet into an array of objects of type T
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayRowHandler

public ArrayRowHandler()
Constructor, creates a new ArrayRowHandler object which returns arrays of type Object[].


ArrayRowHandler

public ArrayRowHandler(Class<T[]> clazz)
Constructor, creates a new ArrayRowHandler object which generates arrays of the given class.

Parameters:
clazz - class of the array
Method Detail

getObject

public T[] getObject(ResultSet resultSet)
              throws SQLException
Converts the specified ResultSet into an array of objects of type T

Specified by:
getObject in interface RowHandler<T[]>
Parameters:
resultSet - SQL query result
Returns:
an object created from the firs column of the current row in the specified ResultSet
Throws:
SQLException - if an exception is thrown when the object is created


Copyright © 2011-2013 e-point SA. All Rights Reserved.