Class StringColumnVTI
- All Implemented Interfaces:
AutoCloseable, ResultSet, Wrapper, AwareVTI
- Direct Known Subclasses:
XmlVTI
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:
- next( )
- close()
and the following protected method introduced by this class:
- getRawColumn( int columnNumber )
-
Nested Class Summary
Nested classes/interfaces inherited from class VTITemplate
VTITemplate.ColumnDescriptor -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String[]////////////////////////////////////////////////////////////////////////////////private booleanFields inherited from interface ResultSet
CLOSE_CURSORS_AT_COMMIT, CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, HOLD_CURSORS_OVER_COMMIT, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE -
Constructor Summary
ConstructorsConstructorDescriptionStringColumnVTI(String[] columnNames) Build a StringColumnVTI with the given column names -
Method Summary
Modifier and TypeMethodDescriptionprivate voidSet the wasNull flag based on whether this column value turned out to be null.intfindColumn(String columnName) getAsciiStream(int columnIndex) getBigDecimal(int columnIndex) getBinaryStream(int columnIndex) getBlob(int columnIndex) booleangetBoolean(int columnIndex) bytegetByte(int columnIndex) byte[]getBytes(int columnIndex) getClob(int columnIndex) intGet the number of columns.getColumnName(int columnNumber) Get name of a column (1-based indexing).getDate(int columnIndex) doublegetDouble(int columnIndex) private InputStreamgetEncodedStream(String columnValue, String encoding) Turn a string into an appropriately encoded ByteArrayInputStream.floatgetFloat(int columnIndex) intgetInt(int columnIndex) longgetLong(int columnIndex) protected abstract StringgetRawColumn(int columnNumber) Get the string value of the column in the current row identified by the 1-based columnNumber.shortgetShort(int columnIndex) getString(int columnIndex) getTime(int columnIndex) getTimestamp(int columnIndex) private SQLExceptionmakeSQLException(String sqlstate, Object... args) Construct a SQLException from a SQLState and args.private longparseDateTime(String columnValue) Translate a date/time expression into the corresponding long number of milliseconds.voidsetColumnNames(String[] columnNames) Set the column names for this table function.booleanwasNull()////////////////////////////////////////////////////////////////////////////////private SQLExceptionWrap an exception in a SQLException.Methods inherited from class VTITemplate
absolute, afterLast, beforeFirst, cancelRowUpdates, clearWarnings, deleteRow, first, getArray, getArray, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBinaryStream, getBlob, getBoolean, getByte, getBytes, getCharacterStream, getCharacterStream, getClob, getConcurrency, getContext, getCursorName, getDate, getDate, getDate, getDouble, getFetchDirection, getFetchSize, getFloat, getHoldability, getInt, getLong, getMetaData, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getObject, getObject, getRef, getRef, getReturnTableSignature, getRow, getRowId, getRowId, getShort, getSQLXML, getSQLXML, getStatement, getString, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, insertRow, isAfterLast, isBeforeFirst, isClosed, isFirst, isLast, isWrapperFor, last, moveToCurrentRow, moveToInsertRow, notImplemented, previous, refreshRow, relative, rowDeleted, rowInserted, rowUpdated, setContext, setFetchDirection, setFetchSize, unwrap, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateClob, updateClob, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNString, updateNString, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateRowId, updateRowId, updateShort, updateShort, updateSQLXML, updateSQLXML, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestampMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ResultSet
close, next, updateObject, updateObject, updateObject, updateObject
-
Field Details
-
_columnNames
//////////////////////////////////////////////////////////////////////////////// -
_lastColumnWasNull
private boolean _lastColumnWasNull
-
-
Constructor Details
-
StringColumnVTI
Build a StringColumnVTI with the given column names
-
-
Method Details
-
getRawColumn
Get the string value of the column in the current row identified by the 1-based columnNumber.
- Throws:
SQLException
-
setColumnNames
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.
- Throws:
SQLException
-
getColumnCount
public int getColumnCount()Get the number of columns.
-
getColumnName
Get name of a column (1-based indexing).
-
wasNull
////////////////////////////////////////////////////////////////////////////////- Specified by:
wasNullin interfaceResultSet- Overrides:
wasNullin classVTITemplate- Throws:
SQLException
-
findColumn
- Specified by:
findColumnin interfaceResultSet- Overrides:
findColumnin classVTITemplate- Throws:
SQLException
-
getString
- Specified by:
getStringin interfaceResultSet- Overrides:
getStringin classVTITemplate- Throws:
SQLException
-
getBoolean
- Specified by:
getBooleanin interfaceResultSet- Overrides:
getBooleanin classVTITemplate- Throws:
SQLException
-
getByte
- Specified by:
getBytein interfaceResultSet- Overrides:
getBytein classVTITemplate- Throws:
SQLException
-
getShort
- Specified by:
getShortin interfaceResultSet- Overrides:
getShortin classVTITemplate- Throws:
SQLException
-
getInt
- Specified by:
getIntin interfaceResultSet- Overrides:
getIntin classVTITemplate- Throws:
SQLException
-
getLong
- Specified by:
getLongin interfaceResultSet- Overrides:
getLongin classVTITemplate- Throws:
SQLException
-
getFloat
- Specified by:
getFloatin interfaceResultSet- Overrides:
getFloatin classVTITemplate- Throws:
SQLException
-
getDouble
- Specified by:
getDoublein interfaceResultSet- Overrides:
getDoublein classVTITemplate- Throws:
SQLException
-
getBigDecimal
- Specified by:
getBigDecimalin interfaceResultSet- Overrides:
getBigDecimalin classVTITemplate- Throws:
SQLException
-
getBytes
- Specified by:
getBytesin interfaceResultSet- Overrides:
getBytesin classVTITemplate- Throws:
SQLException
-
getDate
- Specified by:
getDatein interfaceResultSet- Overrides:
getDatein classVTITemplate- Throws:
SQLException
-
getTime
- Specified by:
getTimein interfaceResultSet- Overrides:
getTimein classVTITemplate- Throws:
SQLException
-
getTimestamp
- Specified by:
getTimestampin interfaceResultSet- Overrides:
getTimestampin classVTITemplate- Throws:
SQLException
-
getAsciiStream
- Specified by:
getAsciiStreamin interfaceResultSet- Overrides:
getAsciiStreamin classVTITemplate- Throws:
SQLException
-
getBinaryStream
- Specified by:
getBinaryStreamin interfaceResultSet- Overrides:
getBinaryStreamin classVTITemplate- Throws:
SQLException
-
getBlob
- Specified by:
getBlobin interfaceResultSet- Overrides:
getBlobin classVTITemplate- Throws:
SQLException
-
getClob
- Specified by:
getClobin interfaceResultSet- Overrides:
getClobin classVTITemplate- Throws:
SQLException
-
checkNull
Set the wasNull flag based on whether this column value turned out to be null.
-
wrap
Wrap an exception in a SQLException.
-
parseDateTime
Translate a date/time expression into the corresponding long number of milliseconds.
- Throws:
SQLException
-
getEncodedStream
Turn a string into an appropriately encoded ByteArrayInputStream.
- Throws:
SQLException
-
makeSQLException
Construct a SQLException from a SQLState and args.
-