This is an abstract table function which assumes that all columns are strings and which coerces the strings to reasonable values for various getXXX() methods. Subclasses must implement the following ResultSet methods:
and the following protected method introduced by this class:
| Modifier and Type | Field and Description |
|---|---|
| private String[] | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | StringColumnVTI(String[]
The names of the VTI's columns columnNames)Build a StringColumnVTI with the given column names |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public int | findColumn(String
the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column columnName)Overrides org. Implements java. Maps the given |
| public InputStream | getAsciiStream(int
the first column is 1, the second is 2, ... columnIndex)Overrides org. Implements java. Retrieves the value of the designated column in the current row
of this |
| public BigDecimal | getBigDecimal(int
the first column is 1, the second is 2, ... columnIndex)Overrides org. Implements java. Retrieves the value of the designated column in the current row
of this |
| public InputStream | getBinaryStream(int
the first column is 1, the second is 2, ... columnIndex)Overrides org. Implements java. Retrieves the value of the designated column in the current row
of this |
| public Blob | getBlob(int
the first column is 1, the second is 2, ... columnIndex)Overrides org. Implements java. Retrieves the value of the designated column in the current row
of this |
| public boolean | getBoolean(int
the first column is 1, the second is 2, ... columnIndex)Overrides org. Implements java. Retrieves the value of the designated column in the current row
of this |
| public byte | getByte(int
the first column is 1, the second is 2, ... columnIndex)Overrides org. Implements java. Retrieves the value of the designated column in the current row
of this |
| public byte[] | getBytes(int
the first column is 1, the second is 2, ... columnIndex)Overrides org. Implements java. Retrieves the value of the designated column in the current row
of this |
| public Clob | getClob(int
the first column is 1, the second is 2, ... columnIndex)Overrides org. Implements java. Retrieves the value of the designated column in the current row
of this |
| public int | |
| public String | Returns: the name of the corresponding column1-based position of column whose name is needed columnNumber)Get name of a column (1-based indexing). |
| public Date | getDate(int
the first column is 1, the second is 2, ... columnIndex)Overrides org. Implements java. Retrieves the value of the designated column in the current row
of this |
| public double | getDouble(int
the first column is 1, the second is 2, ... columnIndex)Overrides org. Implements java. Retrieves the value of the designated column in the current row
of this |
| private InputStream | getEncodedStream(String columnValue, String encoding)
Turn a string into an appropriately encoded ByteArrayInputStream. |
| public float | getFloat(int
the first column is 1, the second is 2, ... columnIndex)Overrides org. Implements java. Retrieves the value of the designated column in the current row
of this |
| public int | getInt(int
the first column is 1, the second is 2, ... columnIndex)Overrides org. Implements java. Retrieves the value of the designated column in the current row
of this |
| public long | getLong(int
the first column is 1, the second is 2, ... columnIndex)Overrides org. Implements java. Retrieves the value of the designated column in the current row
of this |
| protected abstract String | Returns: the string value of the corresponding columnThe 1-based column index to lookup columnNumber)Get the string value of the column in the current row identified by the 1-based columnNumber. |
| public short | getShort(int
the first column is 1, the second is 2, ... columnIndex)Overrides org. Implements java. Retrieves the value of the designated column in the current row
of this |
| public String | getString(int
the first column is 1, the second is 2, ... columnIndex)Overrides org. Implements java. Retrieves the value of the designated column in the current row
of this |
| public Time | getTime(int
the first column is 1, the second is 2, ... columnIndex)Overrides org. Implements java. Retrieves the value of the designated column in the current row
of this |
| public Timestamp | getTimestamp(int
the first column is 1, the second is 2, ... columnIndex)Overrides org. Implements java. Retrieves the value of the designated column in the current row
of this |
| private SQLException | makeSQLException(String sqlstate, Object... args)
Construct a SQLException from a SQLState and args. |
| private long | parseDateTime(String columnValue)
Translate a date/time expression into the corresponding long number of milliseconds. |
| public void | setColumnNames(String[]
The names of the columns to be returned by this VTI columnNames)Set the column names for this table function. |
| public boolean | wasNull()
Overrides org. Implements java. Reports whether
the last column read had a value of SQL |
| private SQLException |
| _columnNames | back to summary |
|---|---|
| private String[] _columnNames | |
| _lastColumnWasNull | back to summary |
|---|---|
| private boolean _lastColumnWasNull | |
| StringColumnVTI | back to summary |
|---|---|
| public StringColumnVTI(String[] columnNames) Build a StringColumnVTI with the given column names
| |
| checkNull | back to summary |
|---|---|
| private void checkNull(String columnValue) Set the wasNull flag based on whether this column value turned out to be null. | |
| findColumn | back to summary |
|---|---|
| public int findColumn(String columnName) throws SQLException Overrides org. Implements java. Doc from java. Maps the given
| |
| getAsciiStream | back to summary |
|---|---|
| public InputStream getAsciiStream(int columnIndex) throws SQLException Overrides org. Implements java. Doc from java. Retrieves the value of the designated column in the current row
of this Note All the data in the returned stream must be
read prior to getting the value of any other column. The next
call to a getter method implicitly closes the stream. Also, a
stream may return
| |
| getBigDecimal | back to summary |
|---|---|
| public BigDecimal getBigDecimal(int columnIndex) throws SQLException Overrides org. Implements java. Doc from java. Retrieves the value of the designated column in the current row
of this
| |
| getBinaryStream | back to summary |
|---|---|
| public InputStream getBinaryStream(int columnIndex) throws SQLException Overrides org. Implements java. Doc from java. Retrieves the value of the designated column in the current row
of this Note All the data in the returned stream must be
read prior to getting the value of any other column. The next
call to a getter method implicitly closes the stream. Also, a
stream may return
| |
| getBlob | back to summary |
|---|---|
| public Blob getBlob(int columnIndex) throws SQLException Overrides org. Implements java. Doc from java. Retrieves the value of the designated column in the current row
of this
| |
| getBoolean | back to summary |
|---|---|
| public boolean getBoolean(int columnIndex) throws SQLException Overrides org. Implements java. Doc from java. Retrieves the value of the designated column in the current row
of this If the designated column has a datatype of CHAR or VARCHAR
and contains a "0" or has a datatype of BIT, TINYINT, SMALLINT, INTEGER or BIGINT
and contains a 0, a value of
| |
| getByte | back to summary |
|---|---|
| public byte getByte(int columnIndex) throws SQLException Overrides org. Implements java. Doc from java. Retrieves the value of the designated column in the current row
of this
| |
| getBytes | back to summary |
|---|---|
| public byte[] getBytes(int columnIndex) throws SQLException Overrides org. Implements java. Doc from java. Retrieves the value of the designated column in the current row
of this
| |
| getClob | back to summary |
|---|---|
| public Clob getClob(int columnIndex) throws SQLException Overrides org. Implements java. Doc from java. Retrieves the value of the designated column in the current row
of this
| |
| getColumnCount | back to summary |
|---|---|
| public int getColumnCount() Get the number of columns.
| |
| getColumnName | back to summary |
|---|---|
| public String getColumnName(int columnNumber) Get name of a column (1-based indexing).
| |
| getDate | back to summary |
|---|---|
| public Date getDate(int columnIndex) throws SQLException Overrides org. Implements java. Doc from java. Retrieves the value of the designated column in the current row
of this
| |
| getDouble | back to summary |
|---|---|
| public double getDouble(int columnIndex) throws SQLException Overrides org. Implements java. Doc from java. Retrieves the value of the designated column in the current row
of this
| |
| getEncodedStream | back to summary |
|---|---|
| private InputStream getEncodedStream(String columnValue, String encoding) throws SQLException Turn a string into an appropriately encoded ByteArrayInputStream. | |
| getFloat | back to summary |
|---|---|
| public float getFloat(int columnIndex) throws SQLException Overrides org. Implements java. Doc from java. Retrieves the value of the designated column in the current row
of this
| |
| getInt | back to summary |
|---|---|
| public int getInt(int columnIndex) throws SQLException Overrides org. Implements java. Doc from java. Retrieves the value of the designated column in the current row
of this
| |
| getLong | back to summary |
|---|---|
| public long getLong(int columnIndex) throws SQLException Overrides org. Implements java. Doc from java. Retrieves the value of the designated column in the current row
of this
| |
| getRawColumn | back to summary |
|---|---|
| protected abstract String getRawColumn(int columnNumber) throws SQLException Get the string value of the column in the current row identified by the 1-based columnNumber.
| |
| getShort | back to summary |
|---|---|
| public short getShort(int columnIndex) throws SQLException Overrides org. Implements java. Doc from java. Retrieves the value of the designated column in the current row
of this
| |
| getString | back to summary |
|---|---|
| public String getString(int columnIndex) throws SQLException Overrides org. Implements java. Doc from java. Retrieves the value of the designated column in the current row
of this
| |
| getTime | back to summary |
|---|---|
| public Time getTime(int columnIndex) throws SQLException Overrides org. Implements java. Doc from java. Retrieves the value of the designated column in the current row
of this
| |
| getTimestamp | back to summary |
|---|---|
| public Timestamp getTimestamp(int columnIndex) throws SQLException Overrides org. Implements java. Doc from java. Retrieves the value of the designated column in the current row
of this
| |
| makeSQLException | back to summary |
|---|---|
| private SQLException makeSQLException(String sqlstate, Object... args) Construct a SQLException from a SQLState and args. | |
| parseDateTime | back to summary |
|---|---|
| private long parseDateTime(String columnValue) throws SQLException Translate a date/time expression into the corresponding long number of milliseconds. | |
| setColumnNames | back to summary |
|---|---|
| public void setColumnNames(String[] columnNames) throws SQLException Set the column names for this table function. This is useful for AwareVTIs, which need to figure out their column names after analyzing their execution context. Throws an exception if the column names have already been set.
| |
| wasNull | back to summary |
|---|---|
| public boolean wasNull() throws SQLException Overrides org. Implements java. Doc from java. Reports whether
the last column read had a value of SQL
| |
| wrap | back to summary |
|---|---|
| private SQLException wrap(Throwable t) Wrap an exception in a SQLException. | |