| java.lang.Object jpersist.utils.ResultSetUtils
ResultSetUtils | public class ResultSetUtils (Code) | | This class provides several static utility methods for retrieving data from a result set.
|
getColumnNames | public static String[] getColumnNames(ResultSet resultSet) throws JPersistException, SQLException(Code) | | Returns an array of strings representing the column names in the result set.
Parameters: resultSet - the result set an array of strings |
getRowDataCollection | public static Collection getRowDataCollection(ResultSet resultSet, Collection c) throws JPersistException, SQLException(Code) | | Returns a collection of the current rows data.
Parameters: resultSet - a valid result set Parameters: c - the collection to load with the current rows data the collection that was passed in |
getRowDataMap | public static Map getRowDataMap(ResultSet resultSet, Map map) throws JPersistException, SQLException(Code) | | Returns a map of column name and value pairs from the current row of the result set.
Parameters: resultSet - a valid result set Parameters: map - the map to load with column name and value pairs the map that was passed in |
getRowDataObjects | public static Object[] getRowDataObjects(ResultSet resultSet) throws JPersistException, SQLException(Code) | | Returns an array of objects obtained from the current rows data.
Parameters: resultSet - a valid result set an array of objects |
loadCollection | public static Collection loadCollection(ResultSet resultSet, Collection c, boolean singleObject) throws JPersistException, SQLException, InstantiationException, IllegalAccessException(Code) | | Loads a collection with row data from the result set. If the rows have more than one value,
then a collection of collections (of the same type) is created, otherwise depending on the
value of singleObject, a collection of a given object is created.
Parameters: resultSet - a valid result set Parameters: c - the collection to load with the result set data Parameters: singleObject - if true and a row has a single column then an object will be added to the collection. If false then a collection of the row data is added to the collection passed in. the collection that was passed in |
loadMap | public static Map loadMap(ResultSet resultSet, Map map) throws JPersistException, SQLException(Code) | | Loads a map with key and value pairs from the first and second column of each row in the result set.
Parameters: resultSet - a valid result set Parameters: map - the map to load with key and value pairs the map that was passed in |
loadMap | public static Map loadMap(ResultSet resultSet, Map map, int keyColumn, int valueColumn) throws JPersistException, SQLException(Code) | | Loads a map with key and value pairs from keyColumn and valueColumn of each row in the result set.
Parameters: resultSet - a valid result set Parameters: map - the map to load with keyColumn and valueColumn Parameters: keyColumn - the key column Parameters: valueColumn - the value column the map that was passed in |
|
|