public abstract class StringColumnVTI extends VTITemplate
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 java.lang.String[] |
_columnNames |
private boolean |
_lastColumnWasNull |
| Constructor and Description |
|---|
StringColumnVTI(java.lang.String[] columnNames)
Build a StringColumnVTI with the given column names
|
| Modifier and Type | Method and Description |
|---|---|
private void |
checkNull(java.lang.String columnValue)
Set the wasNull flag based on whether this column value turned out to be null.
|
int |
findColumn(java.lang.String columnName) |
java.io.InputStream |
getAsciiStream(int columnIndex) |
java.math.BigDecimal |
getBigDecimal(int columnIndex) |
java.io.InputStream |
getBinaryStream(int columnIndex) |
java.sql.Blob |
getBlob(int columnIndex) |
boolean |
getBoolean(int columnIndex) |
byte |
getByte(int columnIndex) |
byte[] |
getBytes(int columnIndex) |
java.sql.Clob |
getClob(int columnIndex) |
int |
getColumnCount()
Get the number of columns.
|
java.lang.String |
getColumnName(int columnNumber)
Get name of a column (1-based indexing).
|
java.sql.Date |
getDate(int columnIndex) |
double |
getDouble(int columnIndex) |
private java.io.InputStream |
getEncodedStream(java.lang.String columnValue,
java.lang.String encoding)
Turn a string into an appropriately encoded ByteArrayInputStream.
|
float |
getFloat(int columnIndex) |
int |
getInt(int columnIndex) |
long |
getLong(int columnIndex) |
protected abstract java.lang.String |
getRawColumn(int columnNumber)
Get the string value of the column in the current row identified by the 1-based columnNumber.
|
short |
getShort(int columnIndex) |
java.lang.String |
getString(int columnIndex) |
java.sql.Time |
getTime(int columnIndex) |
java.sql.Timestamp |
getTimestamp(int columnIndex) |
private long |
parseDateTime(java.lang.String columnValue)
Translate a date/time expression into the corresponding long number of
milliseconds.
|
boolean |
wasNull() |
private java.sql.SQLException |
wrap(java.lang.Throwable t)
Wrap an exception in a SQLException.
|
close, getBigDecimal, getBigDecimal, getBoolean, getByte, getBytes, getDate, getDouble, getFloat, getInt, getLong, getObject, getShort, getString, getTime, getTimestamp, nextabsolute, afterLast, beforeFirst, cancelRowUpdates, clearWarnings, deleteRow, first, getArray, getArray, getAsciiStream, getBigDecimal, getBinaryStream, getBlob, getCharacterStream, getCharacterStream, getClob, getConcurrency, getCursorName, getDate, getDate, getFetchDirection, getFetchSize, getMetaData, getObject, getObject, getObject, getRef, getRef, getRow, getStatement, getTime, getTime, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, insertRow, isAfterLast, isBeforeFirst, isFirst, isLast, last, moveToCurrentRow, moveToInsertRow, notImplemented, previous, refreshRow, relative, rowDeleted, rowInserted, rowUpdated, setFetchDirection, setFetchSize, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateShort, updateShort, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestampclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetHoldability, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getRowId, getRowId, getSQLXML, getSQLXML, isClosed, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBlob, updateBlob, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateClob, updateClob, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNString, updateNString, updateRowId, updateRowId, updateSQLXML, updateSQLXMLprivate java.lang.String[] _columnNames
private boolean _lastColumnWasNull
public StringColumnVTI(java.lang.String[] columnNames)
Build a StringColumnVTI with the given column names
protected abstract java.lang.String getRawColumn(int columnNumber)
throws java.sql.SQLException
Get the string value of the column in the current row identified by the 1-based columnNumber.
java.sql.SQLExceptionpublic int getColumnCount()
Get the number of columns.
public java.lang.String getColumnName(int columnNumber)
Get name of a column (1-based indexing).
public boolean wasNull()
throws java.sql.SQLException
wasNull in interface java.sql.ResultSetwasNull in class VTITemplateBasejava.sql.SQLExceptionpublic int findColumn(java.lang.String columnName)
throws java.sql.SQLException
findColumn in interface java.sql.ResultSetfindColumn in class VTITemplateBasejava.sql.SQLExceptionpublic java.lang.String getString(int columnIndex)
throws java.sql.SQLException
getString in interface java.sql.ResultSetgetString in class VTITemplateBasejava.sql.SQLExceptionpublic boolean getBoolean(int columnIndex)
throws java.sql.SQLException
getBoolean in interface java.sql.ResultSetgetBoolean in class VTITemplateBasejava.sql.SQLExceptionpublic byte getByte(int columnIndex)
throws java.sql.SQLException
getByte in interface java.sql.ResultSetgetByte in class VTITemplateBasejava.sql.SQLExceptionpublic short getShort(int columnIndex)
throws java.sql.SQLException
getShort in interface java.sql.ResultSetgetShort in class VTITemplateBasejava.sql.SQLExceptionpublic int getInt(int columnIndex)
throws java.sql.SQLException
getInt in interface java.sql.ResultSetgetInt in class VTITemplateBasejava.sql.SQLExceptionpublic long getLong(int columnIndex)
throws java.sql.SQLException
getLong in interface java.sql.ResultSetgetLong in class VTITemplateBasejava.sql.SQLExceptionpublic float getFloat(int columnIndex)
throws java.sql.SQLException
getFloat in interface java.sql.ResultSetgetFloat in class VTITemplateBasejava.sql.SQLExceptionpublic double getDouble(int columnIndex)
throws java.sql.SQLException
getDouble in interface java.sql.ResultSetgetDouble in class VTITemplateBasejava.sql.SQLExceptionpublic java.math.BigDecimal getBigDecimal(int columnIndex)
throws java.sql.SQLException
getBigDecimal in interface java.sql.ResultSetgetBigDecimal in class VTITemplateBasejava.sql.SQLExceptionpublic byte[] getBytes(int columnIndex)
throws java.sql.SQLException
getBytes in interface java.sql.ResultSetgetBytes in class VTITemplateBasejava.sql.SQLExceptionpublic java.sql.Date getDate(int columnIndex)
throws java.sql.SQLException
getDate in interface java.sql.ResultSetgetDate in class VTITemplateBasejava.sql.SQLExceptionpublic java.sql.Time getTime(int columnIndex)
throws java.sql.SQLException
getTime in interface java.sql.ResultSetgetTime in class VTITemplateBasejava.sql.SQLExceptionpublic java.sql.Timestamp getTimestamp(int columnIndex)
throws java.sql.SQLException
getTimestamp in interface java.sql.ResultSetgetTimestamp in class VTITemplateBasejava.sql.SQLExceptionpublic java.io.InputStream getAsciiStream(int columnIndex)
throws java.sql.SQLException
getAsciiStream in interface java.sql.ResultSetgetAsciiStream in class VTITemplateBasejava.sql.SQLExceptionpublic java.io.InputStream getBinaryStream(int columnIndex)
throws java.sql.SQLException
getBinaryStream in interface java.sql.ResultSetgetBinaryStream in class VTITemplateBasejava.sql.SQLExceptionpublic java.sql.Blob getBlob(int columnIndex)
throws java.sql.SQLException
getBlob in interface java.sql.ResultSetgetBlob in class VTITemplateBasejava.sql.SQLExceptionpublic java.sql.Clob getClob(int columnIndex)
throws java.sql.SQLException
getClob in interface java.sql.ResultSetgetClob in class VTITemplateBasejava.sql.SQLExceptionprivate void checkNull(java.lang.String columnValue)
Set the wasNull flag based on whether this column value turned out to be null.
private java.sql.SQLException wrap(java.lang.Throwable t)
Wrap an exception in a SQLException.
private long parseDateTime(java.lang.String columnValue)
throws java.sql.SQLException
Translate a date/time expression into the corresponding long number of milliseconds.
java.sql.SQLExceptionprivate java.io.InputStream getEncodedStream(java.lang.String columnValue,
java.lang.String encoding)
throws java.sql.SQLException
Turn a string into an appropriately encoded ByteArrayInputStream.
java.sql.SQLExceptionApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.