public class RestrictedTableVTI
extends org.apache.derby.vti.VTITemplate
implements org.apache.derby.vti.RestrictedVTI
This class contains a table function which can be used to read data from a Derby table.
Modifier and Type | Field and Description |
---|---|
private java.lang.String[] |
_columnNames |
private int[] |
_columnNumberMap |
private java.sql.Connection |
_connection |
private static java.lang.String |
_lastQuery |
private java.sql.PreparedStatement |
_preparedStatement |
private org.apache.derby.vti.Restriction |
_restriction |
private java.sql.ResultSet |
_resultSet |
private java.lang.String |
_schemaName |
private java.lang.String |
_tableName |
Modifier | Constructor and Description |
---|---|
protected |
RestrictedTableVTI(java.lang.String schemaName,
java.lang.String tableName) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
private static java.lang.String |
doubleQuote(java.lang.String text) |
java.io.InputStream |
getAsciiStream(int i) |
java.math.BigDecimal |
getBigDecimal(int i) |
java.math.BigDecimal |
getBigDecimal(int i,
int scale)
Deprecated.
|
java.io.InputStream |
getBinaryStream(int i) |
java.sql.Blob |
getBlob(int i) |
boolean |
getBoolean(int i) |
byte |
getByte(int i) |
byte[] |
getBytes(int i) |
java.io.Reader |
getCharacterStream(int i) |
java.sql.Clob |
getClob(int i) |
java.sql.Date |
getDate(int i) |
java.sql.Date |
getDate(int i,
java.util.Calendar cal) |
private static java.sql.Connection |
getDerbyConnection() |
double |
getDouble(int i) |
float |
getFloat(int i) |
int |
getInt(int i) |
static java.lang.String |
getLastQuery()
Scalar function to retrieve the last query generated by this machinery.
|
long |
getLong(int i) |
java.sql.ResultSetMetaData |
getMetaData() |
java.lang.Object |
getObject(int i) |
short |
getShort(int i) |
java.lang.String |
getString(int i) |
java.sql.Time |
getTime(int i) |
java.sql.Time |
getTime(int i,
java.util.Calendar cal) |
java.sql.Timestamp |
getTimestamp(int i) |
java.sql.Timestamp |
getTimestamp(int i,
java.util.Calendar cal) |
void |
initScan(java.lang.String[] columnNames,
org.apache.derby.vti.Restriction restriction) |
boolean |
isClosed() |
private java.lang.String |
makeQuery()
Build the query which will be sent to the nested connection.
|
private int |
mapColumnNumber(int derbyNumber)
Map a 1-based Derby column number to a 1-based column number in the
query.
|
boolean |
next() |
private static java.sql.PreparedStatement |
prepareStatement(java.sql.Connection conn,
java.lang.String text) |
static RestrictedTableVTI |
readTable(java.lang.String schemaName,
java.lang.String tableName)
Table function to read a table in Derby.
|
private static java.lang.String |
singleQuote(java.lang.String text) |
boolean |
wasNull() |
absolute, afterLast, beforeFirst, cancelRowUpdates, clearWarnings, deleteRow, findColumn, first, getArray, getArray, getAsciiStream, getBigDecimal, getBigDecimal, getBinaryStream, getBlob, getBoolean, getByte, getBytes, getCharacterStream, getClob, getConcurrency, getContext, getCursorName, getDate, getDate, getDouble, getFetchDirection, getFetchSize, getFloat, getHoldability, getInt, getLong, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getObject, getRef, getRef, getReturnTableSignature, getRow, getRowId, getRowId, getShort, getSQLXML, getSQLXML, getStatement, getString, getTime, getTime, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, insertRow, isAfterLast, isBeforeFirst, 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, updateTimestamp
private java.lang.String _schemaName
private java.lang.String _tableName
private java.sql.Connection _connection
private java.lang.String[] _columnNames
private org.apache.derby.vti.Restriction _restriction
private int[] _columnNumberMap
private java.sql.PreparedStatement _preparedStatement
private java.sql.ResultSet _resultSet
private static java.lang.String _lastQuery
protected RestrictedTableVTI(java.lang.String schemaName, java.lang.String tableName) throws java.lang.Exception
java.lang.Exception
public static RestrictedTableVTI readTable(java.lang.String schemaName, java.lang.String tableName) throws java.lang.Exception
Table function to read a table in Derby.
java.lang.Exception
public static java.lang.String getLastQuery()
Scalar function to retrieve the last query generated by this machinery.
public void close() throws java.sql.SQLException
close
in interface java.lang.AutoCloseable
close
in interface java.sql.ResultSet
java.sql.SQLException
public boolean next() throws java.sql.SQLException
next
in interface java.sql.ResultSet
java.sql.SQLException
public boolean isClosed()
isClosed
in interface java.sql.ResultSet
isClosed
in class org.apache.derby.vti.VTITemplate
public boolean wasNull() throws java.sql.SQLException
wasNull
in interface java.sql.ResultSet
wasNull
in class org.apache.derby.vti.VTITemplate
java.sql.SQLException
public java.sql.ResultSetMetaData getMetaData() throws java.sql.SQLException
getMetaData
in interface java.sql.ResultSet
getMetaData
in class org.apache.derby.vti.VTITemplate
java.sql.SQLException
public java.io.InputStream getAsciiStream(int i) throws java.sql.SQLException
getAsciiStream
in interface java.sql.ResultSet
getAsciiStream
in class org.apache.derby.vti.VTITemplate
java.sql.SQLException
public java.math.BigDecimal getBigDecimal(int i) throws java.sql.SQLException
getBigDecimal
in interface java.sql.ResultSet
getBigDecimal
in class org.apache.derby.vti.VTITemplate
java.sql.SQLException
@Deprecated public java.math.BigDecimal getBigDecimal(int i, int scale) throws java.sql.SQLException
getBigDecimal
in interface java.sql.ResultSet
getBigDecimal
in class org.apache.derby.vti.VTITemplate
java.sql.SQLException
public java.io.InputStream getBinaryStream(int i) throws java.sql.SQLException
getBinaryStream
in interface java.sql.ResultSet
getBinaryStream
in class org.apache.derby.vti.VTITemplate
java.sql.SQLException
public java.sql.Blob getBlob(int i) throws java.sql.SQLException
getBlob
in interface java.sql.ResultSet
getBlob
in class org.apache.derby.vti.VTITemplate
java.sql.SQLException
public boolean getBoolean(int i) throws java.sql.SQLException
getBoolean
in interface java.sql.ResultSet
getBoolean
in class org.apache.derby.vti.VTITemplate
java.sql.SQLException
public byte getByte(int i) throws java.sql.SQLException
getByte
in interface java.sql.ResultSet
getByte
in class org.apache.derby.vti.VTITemplate
java.sql.SQLException
public byte[] getBytes(int i) throws java.sql.SQLException
getBytes
in interface java.sql.ResultSet
getBytes
in class org.apache.derby.vti.VTITemplate
java.sql.SQLException
public java.io.Reader getCharacterStream(int i) throws java.sql.SQLException
getCharacterStream
in interface java.sql.ResultSet
getCharacterStream
in class org.apache.derby.vti.VTITemplate
java.sql.SQLException
public java.sql.Clob getClob(int i) throws java.sql.SQLException
getClob
in interface java.sql.ResultSet
getClob
in class org.apache.derby.vti.VTITemplate
java.sql.SQLException
public java.sql.Date getDate(int i) throws java.sql.SQLException
getDate
in interface java.sql.ResultSet
getDate
in class org.apache.derby.vti.VTITemplate
java.sql.SQLException
public java.sql.Date getDate(int i, java.util.Calendar cal) throws java.sql.SQLException
getDate
in interface java.sql.ResultSet
getDate
in class org.apache.derby.vti.VTITemplate
java.sql.SQLException
public double getDouble(int i) throws java.sql.SQLException
getDouble
in interface java.sql.ResultSet
getDouble
in class org.apache.derby.vti.VTITemplate
java.sql.SQLException
public float getFloat(int i) throws java.sql.SQLException
getFloat
in interface java.sql.ResultSet
getFloat
in class org.apache.derby.vti.VTITemplate
java.sql.SQLException
public int getInt(int i) throws java.sql.SQLException
getInt
in interface java.sql.ResultSet
getInt
in class org.apache.derby.vti.VTITemplate
java.sql.SQLException
public long getLong(int i) throws java.sql.SQLException
getLong
in interface java.sql.ResultSet
getLong
in class org.apache.derby.vti.VTITemplate
java.sql.SQLException
public java.lang.Object getObject(int i) throws java.sql.SQLException
getObject
in interface java.sql.ResultSet
getObject
in class org.apache.derby.vti.VTITemplate
java.sql.SQLException
public short getShort(int i) throws java.sql.SQLException
getShort
in interface java.sql.ResultSet
getShort
in class org.apache.derby.vti.VTITemplate
java.sql.SQLException
public java.lang.String getString(int i) throws java.sql.SQLException
getString
in interface java.sql.ResultSet
getString
in class org.apache.derby.vti.VTITemplate
java.sql.SQLException
public java.sql.Time getTime(int i) throws java.sql.SQLException
getTime
in interface java.sql.ResultSet
getTime
in class org.apache.derby.vti.VTITemplate
java.sql.SQLException
public java.sql.Time getTime(int i, java.util.Calendar cal) throws java.sql.SQLException
getTime
in interface java.sql.ResultSet
getTime
in class org.apache.derby.vti.VTITemplate
java.sql.SQLException
public java.sql.Timestamp getTimestamp(int i) throws java.sql.SQLException
getTimestamp
in interface java.sql.ResultSet
getTimestamp
in class org.apache.derby.vti.VTITemplate
java.sql.SQLException
public java.sql.Timestamp getTimestamp(int i, java.util.Calendar cal) throws java.sql.SQLException
getTimestamp
in interface java.sql.ResultSet
getTimestamp
in class org.apache.derby.vti.VTITemplate
java.sql.SQLException
public void initScan(java.lang.String[] columnNames, org.apache.derby.vti.Restriction restriction) throws java.sql.SQLException
initScan
in interface org.apache.derby.vti.RestrictedVTI
java.sql.SQLException
private static java.sql.Connection getDerbyConnection() throws java.sql.SQLException
java.sql.SQLException
private java.lang.String makeQuery()
Build the query which will be sent to the nested connection.
private static java.lang.String doubleQuote(java.lang.String text)
private static java.lang.String singleQuote(java.lang.String text)
private static java.sql.PreparedStatement prepareStatement(java.sql.Connection conn, java.lang.String text) throws java.sql.SQLException
java.sql.SQLException
private int mapColumnNumber(int derbyNumber)
Map a 1-based Derby column number to a 1-based column number in the query.
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.