|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Object | +--intradoc.data.ResultSetUtils
Utilities to simplify the retrieving and manipulation of data in result sets.
| Constructor Summary | |
ResultSetUtils()
|
|
| Method Summary | |
static java.util.Vector |
createFieldInfo(java.lang.String[] fields,
int defLen)
Creates a dummy array of FieldInfo objects each of which is set to the specified length. |
static java.lang.String[][] |
createFilteredStringTable(ResultSet rset,
java.lang.String[] keys,
java.lang.String filterVal)
Service creates a two dimensional string array based on some keys and a filter. |
static FieldInfo[] |
createInfoList(ResultSet rset,
java.lang.String[] fields,
boolean mustExist)
Returns an array of FieldInfo objects corresponding to the array of fields in the 'fields' parameter. |
static DataResultSet |
createResultSetFromProperties(java.util.Properties props)
|
static DataResultSet |
createResultSetFromProperties(java.util.Properties props,
java.lang.String[] keys)
|
static java.lang.String[][] |
createStringTable(ResultSet rset,
java.lang.String[] keys)
Service creates a two dimensional string array based on fields specified by an array of keys. |
static java.lang.String |
findValue(ResultSet rset,
java.lang.String lookupKey,
java.lang.String lookupFilter,
java.lang.String resultKey)
Gets a value from a particular field from the first row that satisfies equality test criteria on another field and its value. |
static java.util.Date |
getDateValue(ResultSet rset,
java.lang.String key)
|
static int |
getIndexMustExist(ResultSet rset,
java.lang.String key)
Gets the field index for a field. |
static java.lang.String |
getValue(ResultSet rset,
java.lang.String key)
Gets the value of a field for the current row of a result set. |
static java.util.Vector |
loadValuesFromSet(ResultSet rset,
java.lang.String lookupKey)
Extracts all the values for a particular field in a result set. |
static java.util.Vector |
loadValuesFromSetEx(ResultSet rset,
java.lang.String lookupKey,
boolean mustExist)
Extracts all the values for a particular field in a result set. |
static void |
sortResultSet(DataResultSet rset,
java.lang.String[] keys)
Sorts a result set using the values of fields in the result set. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ResultSetUtils()
| Method Detail |
public static java.lang.String[][] createFilteredStringTable(ResultSet rset,
java.lang.String[] keys,
java.lang.String filterVal)
throws DataException
rset - The result set containing the values to be retrieved. Search
starts from first row and leaves the result set after the last row.keys - An array with the first element being the filter key and the
other elements being the columns that should be returned as a row in the
two dimensional string array of values extracted.filterVal - If null, all rows are extracted. If not null, then the
value of the field 'keys[0]' is compared against this parameter and if
they are equal the fields 'keys[1] ... keys[keys.length - 1]' are extracted
and a string array holding these values is added to the two dimensional string
array being returned.
DataException - Thrown if one of the values in the 'keys' array
is not in the result set.
public static java.lang.String[][] createStringTable(ResultSet rset,
java.lang.String[] keys)
throws DataException
rset - The result set containing the values to be retrieved.keys - An array containing the columns that should be returned as a row in the
two dimensional string array of values extracted. If null, all columns in order
are returned.
DataException - Thrown if one of the fields cannot be found.createFilteredStringTable(intradoc.data.ResultSet, java.lang.String[], java.lang.String)
public static FieldInfo[] createInfoList(ResultSet rset,
java.lang.String[] fields,
boolean mustExist)
throws DataException
rset - The result set holding information about the fields it contains.fields - An array of field names for which information should be returned. If null,
field values for all columns in order are returned.mustExist - If true, throw a DataException if field is not in result set.
DataException - Thrown if 'mustExist' is true and a field was not found.
public static java.lang.String getValue(ResultSet rset,
java.lang.String key)
rset - The result set that has been set to a particular row.key - The field name of a column in the result set whose value is
requested.
public static java.util.Date getDateValue(ResultSet rset,
java.lang.String key)
public static int getIndexMustExist(ResultSet rset,
java.lang.String key)
throws DataException
rset - The result set that has been set to a particular row.key - The field name of a column in the result set.
DataException - Thrown if field is not in result set.
public static java.lang.String findValue(ResultSet rset,
java.lang.String lookupKey,
java.lang.String lookupFilter,
java.lang.String resultKey)
throws DataException
rset - The result set being searched. Search starts from first row.lookupKey - The field whose value should be tested.lookupFilter - The value that the field 'lookupKey' should have before the
row is deemed to have satisfied the criteria.resultKey - The field whose value should be returned for the first row
satisfying the criteria.
DataException - Thrown if one of the fields specified is not in the
result set.
public static java.util.Vector loadValuesFromSetEx(ResultSet rset,
java.lang.String lookupKey,
boolean mustExist)
throws DataException
rset - Result set holding values to be extracted.lookupKey - The field whose value is desired.mustExist - If true, the lookupKey must exist in the result set.
DataException - Thrown if lookupKey is not a field in the result set.
public static java.util.Vector loadValuesFromSet(ResultSet rset,
java.lang.String lookupKey)
throws DataException
rset - Result set holding values to be extracted.lookupKey - The field whose value is desired.
DataException - Thrown if lookupKey is not a field in the result set.
public static void sortResultSet(DataResultSet rset,
java.lang.String[] keys)
throws DataException
rset - A DataResultSet whose rows are to be sorted. After the method
is finished this parameter will contained the result set, but ordered by
using the values of the fields listed in the parameter keys.keys - The fields to be compared. The order of the fields determines
the order of comparison.
DataException - Thrown if one the fields is not in the result set.
public static java.util.Vector createFieldInfo(java.lang.String[] fields,
int defLen)
fields - The field names for each of the FieldInfo objects to
be created.defLen - The default length to set for each FieldInfo object.
If the length is greater than zero, then the FieldInfo 'm_isFixedLen'
attribute is set to true.
Workspace.createTable(java.lang.String, intradoc.data.FieldInfo[], java.lang.String[]),
Workspace.alterTable(java.lang.String, intradoc.data.FieldInfo[], java.lang.String[], java.lang.String[])public static DataResultSet createResultSetFromProperties(java.util.Properties props)
public static DataResultSet createResultSetFromProperties(java.util.Properties props,
java.lang.String[] keys)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
(c) 1996-2005 All rights reserved. Stellent, Inc. |