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
-
public class ResultSetJELRowReader extends JELRowReader
JELRowReader for accessing JDBCResultSet
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 Constructor Description ResultSetJELRowReader(java.sql.ResultSet rset)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
getBooleanColumnValue(int icol)
Returns a boolean value for a cell of the current row.protected byte
getByteColumnValue(int icol)
Returns a byte value for a cell of the current row.protected char
getCharColumnValue(int icol)
Returns a char value for a cell of the current row.protected java.lang.Class<?>
getColumnClass(int icol)
Returns the class of values returned by a given column.protected int
getColumnIndexByName(java.lang.String name)
Returns the column index of a column in the row given its name.protected Constant<?>
getConstantByName(java.lang.String name)
Returns a constant value for this reader given its name.protected double
getDoubleColumnValue(int icol)
Returns a double value for a cell of the current row.protected float
getFloatColumnValue(int icol)
Returns a float value for a cell of the current row.protected int
getIntColumnValue(int icol)
Returns a int value for a cell of the current row.protected long
getLongColumnValue(int icol)
Returns a long value for a cell of the current row.protected java.lang.Object
getObjectColumnValue(int icol)
Returns an Object value for a cell of the current row.protected short
getShortColumnValue(int icol)
Returns a short value for a cell of the current row.protected Constant<?>
getSpecialByName(java.lang.String name)
Returns the a special quantity which corresponds to a given name, or null if it isn't a special.protected boolean
isBlank(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
-
-
-
-
Method Detail
-
getColumnIndexByName
protected int getColumnIndexByName(java.lang.String name)
Description copied from class:JELRowReader
Returns the column index of a column in the row given its name. Ifname
does not refer to any known column, return -1.- Specified by:
getColumnIndexByName
in classJELRowReader
- Parameters:
name
- column name- Returns:
- column index, or -1
-
getConstantByName
protected Constant<?> getConstantByName(java.lang.String name)
Description copied from class:JELRowReader
Returns a constant value for this reader given its name.- Specified by:
getConstantByName
in classJELRowReader
- Parameters:
name
- constant name- Returns:
- constant, or null
-
isBlank
protected boolean isBlank(int icol)
Description copied from class:JELRowReader
Indicates whether the value in a given column is null.- Specified by:
isBlank
in classJELRowReader
- Parameters:
icol
- column index- Returns:
- true if value at icol is null
-
getColumnClass
protected java.lang.Class<?> getColumnClass(int icol)
Description copied from class:JELRowReader
Returns the class of values returned by a given column. If no column with the given index exists, null should be returned.- Specified by:
getColumnClass
in 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:JELRowReader
Returns 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:
getBooleanColumnValue
in classJELRowReader
- Parameters:
icol
- column index- Returns:
- value
-
getByteColumnValue
protected byte getByteColumnValue(int icol)
Description copied from class:JELRowReader
Returns 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:
getByteColumnValue
in classJELRowReader
- Parameters:
icol
- column index- Returns:
- value
-
getCharColumnValue
protected char getCharColumnValue(int icol)
Description copied from class:JELRowReader
Returns 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:
getCharColumnValue
in classJELRowReader
- Parameters:
icol
- column index- Returns:
- value
-
getShortColumnValue
protected short getShortColumnValue(int icol)
Description copied from class:JELRowReader
Returns 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:
getShortColumnValue
in classJELRowReader
- Parameters:
icol
- column index- Returns:
- value
-
getIntColumnValue
protected int getIntColumnValue(int icol)
Description copied from class:JELRowReader
Returns 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:
getIntColumnValue
in classJELRowReader
- Parameters:
icol
- column index- Returns:
- value
-
getLongColumnValue
protected long getLongColumnValue(int icol)
Description copied from class:JELRowReader
Returns 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:
getLongColumnValue
in classJELRowReader
- Parameters:
icol
- column index- Returns:
- value
-
getFloatColumnValue
protected float getFloatColumnValue(int icol)
Description copied from class:JELRowReader
Returns 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:
getFloatColumnValue
in classJELRowReader
- Parameters:
icol
- column index- Returns:
- value
-
getDoubleColumnValue
protected double getDoubleColumnValue(int icol)
Description copied from class:JELRowReader
Returns 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:
getDoubleColumnValue
in classJELRowReader
- Parameters:
icol
- column index- Returns:
- value
-
getObjectColumnValue
protected java.lang.Object getObjectColumnValue(int icol)
Description copied from class:JELRowReader
Returns an Object value for a cell of the current row.- Specified by:
getObjectColumnValue
in classJELRowReader
- Parameters:
icol
- column index- Returns:
- value
-
getSpecialByName
protected Constant<?> getSpecialByName(java.lang.String name)
Description copied from class:JELRowReader
Returns 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 null value (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:
getSpecialByName
in classJELRowReader
- Parameters:
name
- special name- Returns:
- special, or null
-
-