Package uk.ac.starlink.ttools.jel
Class ResultSetJELRowReader
java.lang.Object
gnu.jel.DVMap
uk.ac.starlink.ttools.jel.JELRowReader
uk.ac.starlink.ttools.jel.ResultSetJELRowReader
JELRowReader for accessing JDBC
ResultSet objects.
Column indices are 1-based, as for other JDBC methods.- Since:
- 10 Dec 2007
- Author:
- Mark Taylor
-
Field Summary
Fields inherited from class uk.ac.starlink.ttools.jel.JELRowReader
COLUMN_ID_CHAR, NULL_QUERY_PREFIX, OBJECT_PREFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleangetBooleanColumnValue(int icol) Returns a boolean value for a cell of the current row.protected bytegetByteColumnValue(int icol) Returns a byte value for a cell of the current row.protected chargetCharColumnValue(int icol) Returns a char value for a cell of the current row.protected Class<?> getColumnClass(int icol) Returns the class of values returned by a given column.protected intgetColumnIndexByName(String name) Returns the column index of a column in the row given its name.protected Constant<?> getConstantByName(String name) Returns a constant value for this reader given its name.protected doublegetDoubleColumnValue(int icol) Returns a double value for a cell of the current row.protected floatgetFloatColumnValue(int icol) Returns a float value for a cell of the current row.protected intgetIntColumnValue(int icol) Returns a int value for a cell of the current row.protected longgetLongColumnValue(int icol) Returns a long value for a cell of the current row.protected ObjectgetObjectColumnValue(int icol) Returns an Object value for a cell of the current row.protected shortgetShortColumnValue(int icol) Returns a short value for a cell of the current row.protected Constant<?> getSpecialByName(String name) Returns the a special quantity which corresponds to a given name, or null if it isn't a special.protected booleanisBlank(int icol) Indicates whether the value in a given column is null.Methods inherited from class uk.ac.starlink.ttools.jel.JELRowReader
evaluate, evaluateBoolean, evaluateDouble, foundNull, getBooleanArrayProperty, getBooleanProperty, getBooleanProperty, getBooleanValue, getByteArrayProperty, getByteProperty, getByteValue, getCharArrayProperty, getCharProperty, getCharValue, getColumnIndex, getDateArrayProperty, getDoubleArrayProperty, getDoubleProperty, getDoubleValue, getFloatArrayProperty, getFloatProperty, getFloatValue, getIntArrayProperty, getIntProperty, getIntValue, getLongArrayProperty, getLongProperty, getLongValue, getNumberProperty, getObjectArrayProperty, getObjectProperty, getShortArrayProperty, getShortProperty, getShortValue, getStringArrayProperty, getStringProperty, getTranslatedColumns, getTranslatedConstants, getTypeName, setFailOnNull, stripPrefix, translate
-
Constructor Details
-
ResultSetJELRowReader
Constructor.- Parameters:
rset- result set- Throws:
SQLException
-
-
Method Details
-
getColumnIndexByName
Description copied from class:JELRowReaderReturns the column index of a column in the row given its name. Ifnamedoes not refer to any known column, return -1.- Specified by:
getColumnIndexByNamein classJELRowReader- Parameters:
name- column name- Returns:
- column index, or -1
-
getConstantByName
Description copied from class:JELRowReaderReturns a constant value for this reader given its name.- Specified by:
getConstantByNamein classJELRowReader- Parameters:
name- constant name- Returns:
- constant, or null
-
isBlank
protected boolean isBlank(int icol) Description copied from class:JELRowReaderIndicates whether the value in a given column is null.- Specified by:
isBlankin classJELRowReader- Parameters:
icol- column index- Returns:
- true if value at icol is null
-
getColumnClass
Description copied from class:JELRowReaderReturns the class of values returned by a given column. If no column with the given index exists, null should be returned.- Specified by:
getColumnClassin classJELRowReader- Parameters:
icol- non-negative column index- Returns:
- value class, or null for non-existent column
-
getBooleanColumnValue
protected boolean getBooleanColumnValue(int icol) Description copied from class:JELRowReaderReturns a boolean value for a cell of the current row. Will only be called if the relevant column is declared boolean. Must callJELRowReader.foundNull()(and return any value) if the result is null.- Specified by:
getBooleanColumnValuein classJELRowReader- Parameters:
icol- column index- Returns:
- value
-
getByteColumnValue
protected byte getByteColumnValue(int icol) Description copied from class:JELRowReaderReturns a byte value for a cell of the current row. Will only be called if the relevant column is declared byte. Must callJELRowReader.foundNull()(and return any value) if the result is null.- Specified by:
getByteColumnValuein classJELRowReader- Parameters:
icol- column index- Returns:
- value
-
getCharColumnValue
protected char getCharColumnValue(int icol) Description copied from class:JELRowReaderReturns a char value for a cell of the current row. Will only be called if the relevant column is declared char. Must callJELRowReader.foundNull()(and return any value) if the result is null.- Specified by:
getCharColumnValuein classJELRowReader- Parameters:
icol- column index- Returns:
- value
-
getShortColumnValue
protected short getShortColumnValue(int icol) Description copied from class:JELRowReaderReturns a short value for a cell of the current row. Will only be called if the relevant column is declared short. Must callJELRowReader.foundNull()(and return any value) if the result is null.- Specified by:
getShortColumnValuein classJELRowReader- Parameters:
icol- column index- Returns:
- value
-
getIntColumnValue
protected int getIntColumnValue(int icol) Description copied from class:JELRowReaderReturns a int value for a cell of the current row. Will only be called if the relevant column is declared int. Must callJELRowReader.foundNull()(and return any value) if the result is null.- Specified by:
getIntColumnValuein classJELRowReader- Parameters:
icol- column index- Returns:
- value
-
getLongColumnValue
protected long getLongColumnValue(int icol) Description copied from class:JELRowReaderReturns a long value for a cell of the current row. Will only be called if the relevant column is declared long. Must callJELRowReader.foundNull()(and return any value) if the result is null.- Specified by:
getLongColumnValuein classJELRowReader- Parameters:
icol- column index- Returns:
- value
-
getFloatColumnValue
protected float getFloatColumnValue(int icol) Description copied from class:JELRowReaderReturns a float value for a cell of the current row. Will only be called if the relevant column is declared float. Must callJELRowReader.foundNull()(and return any value) if the result is null.- Specified by:
getFloatColumnValuein classJELRowReader- Parameters:
icol- column index- Returns:
- value
-
getDoubleColumnValue
protected double getDoubleColumnValue(int icol) Description copied from class:JELRowReaderReturns a double value for a cell of the current row. Will only be called if the relevant column is declared double. Must callJELRowReader.foundNull()(and return any value) if the result is null.- Specified by:
getDoubleColumnValuein classJELRowReader- Parameters:
icol- column index- Returns:
- value
-
getObjectColumnValue
Description copied from class:JELRowReaderReturns an Object value for a cell of the current row.- Specified by:
getObjectColumnValuein classJELRowReader- Parameters:
icol- column index- Returns:
- value
-
getSpecialByName
Description copied from class:JELRowReaderReturns the a special quantity which corresponds to a given name, or null if it isn't a special. Specials are much like constants but they are checked for earlier.The current specials are:
- "null" returns the
nullvalue (this is not built in to the JEL evaluator) - "NULL" flags that an attempt has been made to evaluate a primitive with no value, and thus invalidates the rest of the evaluation
- Overrides:
getSpecialByNamein classJELRowReader- Parameters:
name- special name- Returns:
- special, or null
- "null" returns the
-