# 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 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 JELRowReader

`COLUMN_ID_CHAR, NULL_QUERY_PREFIX, OBJECT_PREFIX`

## Constructor Summary

Constructors
Constructor
Description
`ResultSetJELRowReader(ResultSet rset)`
Constructor.

## Method Summary

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 Class<?>`
`getColumnClass(int icol)`
Returns the class of values returned by a given column.
`protected int`
`getColumnIndexByName(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 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 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(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 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`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ResultSetJELRowReader

public ResultSetJELRowReader(ResultSet rset) throws SQLException
Constructor.

Parameters:
  `rset` - result set
Throws:
  `SQLException`

## Method Details

### getColumnIndexByName

protected int getColumnIndexByName(String name)
Description copied from class: `JELRowReader`
Returns the column index of a column in the row given its name. If `name` does not refer to any known column, return -1.

Specified by:
  `getColumnIndexByName` in class `JELRowReader`
Parameters:
  `name` - column name
Returns:
  column index, or -1

### getConstantByName

protected Constant<?> getConstantByName(String name)
Description copied from class: `JELRowReader`
Returns a constant value for this reader given its name.

Specified by:
  `getConstantByName` in class `JELRowReader`
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 class `JELRowReader`
Parameters:
  `icol` - column index
Returns:
  true if value at icol is null

### getColumnClass

protected 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 class `JELRowReader`
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 call `JELRowReader.foundNull()` (and return any value) if the result is null.

Specified by:
  `getBooleanColumnValue` in class `JELRowReader`
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 call `JELRowReader.foundNull()` (and return any value) if the result is null.

Specified by:
  `getByteColumnValue` in class `JELRowReader`
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 call `JELRowReader.foundNull()` (and return any value) if the result is null.

Specified by:
  `getCharColumnValue` in class `JELRowReader`
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 call `JELRowReader.foundNull()` (and return any value) if the result is null.

Specified by:
  `getShortColumnValue` in class `JELRowReader`
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 call `JELRowReader.foundNull()` (and return any value) if the result is null.

Specified by:
  `getIntColumnValue` in class `JELRowReader`
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 call `JELRowReader.foundNull()` (and return any value) if the result is null.

Specified by:
  `getLongColumnValue` in class `JELRowReader`
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 call `JELRowReader.foundNull()` (and return any value) if the result is null.

Specified by:
  `getFloatColumnValue` in class `JELRowReader`
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 call `JELRowReader.foundNull()` (and return any value) if the result is null.

Specified by:
  `getDoubleColumnValue` in class `JELRowReader`
Parameters:
  `icol` - column index
Returns:
  value

### getObjectColumnValue

protected Object getObjectColumnValue(int icol)
Description copied from class: `JELRowReader`
Returns an Object value for a cell of the current row.

Specified by:
  `getObjectColumnValue` in class `JELRowReader`
Parameters:
  `icol` - column index
Returns:
  value

### getSpecialByName

protected Constant<?> getSpecialByName(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 class `JELRowReader`
Parameters:
  `name` - special name
Returns:
  special, or null