com.isomorphic.sql
Class SQLTransform

java.lang.Object
  |
  +--com.isomorphic.sql.SQLTransform

public class SQLTransform
extends java.lang.Object

SQLTransform provides helper methods for converting java.sql.ResultSet objects to desired return data structures. See the DataSource Operations section of the client reference docs for a mapping of operationType to expected data structure.


Method Summary
static java.util.List toListOfMaps(java.sql.ResultSet rs)
          Converts all rows of a ResultSet object to return a List of Map objects.
static java.util.List toListOfMaps(java.sql.ResultSet rs, long numRows)
          Converts a ResultSet object to return a List of Map objects for the number of rows given by numRows.
 

Method Detail

toListOfMaps

public static java.util.List toListOfMaps(java.sql.ResultSet rs)
                                   throws java.sql.SQLException
Converts all rows of a ResultSet object to return a List of Map objects.

Parameters:
rs - ResultSet object to be converted
Returns:
java.util.List containing the result as a java.util.Map of name-value pairs
Throws:
java.sql.SQLException - propagates any errors encountered in connecting to the data source

toListOfMaps

public static java.util.List toListOfMaps(java.sql.ResultSet rs,
                                          long numRows)
                                   throws java.sql.SQLException
Converts a ResultSet object to return a List of Map objects for the number of rows given by numRows. This expanded signature is primarily useful if you're responding to a paged request.
Parameters:
rs - ResultSet object to be converted
numRows - the number of rows to convert
Returns:
java.util.List containing the result as a java.util.Map of name-value pairs
Throws:
java.sql.SQLException - propagates any errors encountered in connecting to the data source