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) |
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() |
protected java.sql.SQLException |
notImplemented(java.lang.String arg0) |
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() |
getBigDecimal, getBigDecimal, getBoolean, getByte, getBytes, getDate, getDouble, getFloat, getInt, getLong, getObject, getShort, getString, getTime, getTimestampclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetHoldability, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getRowId, getRowId, getSQLXML, getSQLXML, 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, updateObject, updateObject, updateObject, updateObject, updateRowId, updateRowId, updateSQLXML, updateSQLXMLprivate 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.Exceptionpublic 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.Exceptionpublic 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.AutoCloseableclose in interface java.sql.ResultSetclose in class org.apache.derby.vti.VTITemplatejava.sql.SQLExceptionpublic boolean next()
throws java.sql.SQLException
next in interface java.sql.ResultSetnext in class org.apache.derby.vti.VTITemplatejava.sql.SQLExceptionpublic boolean isClosed()
isClosed in interface java.sql.ResultSetpublic boolean wasNull()
throws java.sql.SQLException
wasNull in interface java.sql.ResultSetwasNull in class org.apache.derby.vti.VTITemplatejava.sql.SQLExceptionpublic java.sql.ResultSetMetaData getMetaData()
throws java.sql.SQLException
getMetaData in interface java.sql.ResultSetgetMetaData in class org.apache.derby.vti.VTITemplatejava.sql.SQLExceptionpublic java.io.InputStream getAsciiStream(int i)
throws java.sql.SQLException
getAsciiStream in interface java.sql.ResultSetgetAsciiStream in class org.apache.derby.vti.VTITemplatejava.sql.SQLExceptionpublic java.math.BigDecimal getBigDecimal(int i)
throws java.sql.SQLException
getBigDecimal in interface java.sql.ResultSetgetBigDecimal in class org.apache.derby.vti.VTITemplatejava.sql.SQLExceptionpublic java.math.BigDecimal getBigDecimal(int i,
int scale)
throws java.sql.SQLException
getBigDecimal in interface java.sql.ResultSetgetBigDecimal in class org.apache.derby.vti.VTITemplatejava.sql.SQLExceptionpublic java.io.InputStream getBinaryStream(int i)
throws java.sql.SQLException
getBinaryStream in interface java.sql.ResultSetgetBinaryStream in class org.apache.derby.vti.VTITemplatejava.sql.SQLExceptionpublic java.sql.Blob getBlob(int i)
throws java.sql.SQLException
getBlob in interface java.sql.ResultSetgetBlob in class org.apache.derby.vti.VTITemplatejava.sql.SQLExceptionpublic boolean getBoolean(int i)
throws java.sql.SQLException
getBoolean in interface java.sql.ResultSetgetBoolean in class org.apache.derby.vti.VTITemplatejava.sql.SQLExceptionpublic byte getByte(int i)
throws java.sql.SQLException
getByte in interface java.sql.ResultSetgetByte in class org.apache.derby.vti.VTITemplatejava.sql.SQLExceptionpublic byte[] getBytes(int i)
throws java.sql.SQLException
getBytes in interface java.sql.ResultSetgetBytes in class org.apache.derby.vti.VTITemplatejava.sql.SQLExceptionpublic java.io.Reader getCharacterStream(int i)
throws java.sql.SQLException
getCharacterStream in interface java.sql.ResultSetgetCharacterStream in class org.apache.derby.vti.VTITemplatejava.sql.SQLExceptionpublic java.sql.Clob getClob(int i)
throws java.sql.SQLException
getClob in interface java.sql.ResultSetgetClob in class org.apache.derby.vti.VTITemplatejava.sql.SQLExceptionpublic java.sql.Date getDate(int i)
throws java.sql.SQLException
getDate in interface java.sql.ResultSetgetDate in class org.apache.derby.vti.VTITemplatejava.sql.SQLExceptionpublic java.sql.Date getDate(int i,
java.util.Calendar cal)
throws java.sql.SQLException
getDate in interface java.sql.ResultSetgetDate in class org.apache.derby.vti.VTITemplatejava.sql.SQLExceptionpublic double getDouble(int i)
throws java.sql.SQLException
getDouble in interface java.sql.ResultSetgetDouble in class org.apache.derby.vti.VTITemplatejava.sql.SQLExceptionpublic float getFloat(int i)
throws java.sql.SQLException
getFloat in interface java.sql.ResultSetgetFloat in class org.apache.derby.vti.VTITemplatejava.sql.SQLExceptionpublic int getInt(int i)
throws java.sql.SQLException
getInt in interface java.sql.ResultSetgetInt in class org.apache.derby.vti.VTITemplatejava.sql.SQLExceptionpublic long getLong(int i)
throws java.sql.SQLException
getLong in interface java.sql.ResultSetgetLong in class org.apache.derby.vti.VTITemplatejava.sql.SQLExceptionpublic java.lang.Object getObject(int i)
throws java.sql.SQLException
getObject in interface java.sql.ResultSetgetObject in class org.apache.derby.vti.VTITemplatejava.sql.SQLExceptionpublic short getShort(int i)
throws java.sql.SQLException
getShort in interface java.sql.ResultSetgetShort in class org.apache.derby.vti.VTITemplatejava.sql.SQLExceptionpublic java.lang.String getString(int i)
throws java.sql.SQLException
getString in interface java.sql.ResultSetgetString in class org.apache.derby.vti.VTITemplatejava.sql.SQLExceptionpublic java.sql.Time getTime(int i)
throws java.sql.SQLException
getTime in interface java.sql.ResultSetgetTime in class org.apache.derby.vti.VTITemplatejava.sql.SQLExceptionpublic java.sql.Time getTime(int i,
java.util.Calendar cal)
throws java.sql.SQLException
getTime in interface java.sql.ResultSetgetTime in class org.apache.derby.vti.VTITemplatejava.sql.SQLExceptionpublic java.sql.Timestamp getTimestamp(int i)
throws java.sql.SQLException
getTimestamp in interface java.sql.ResultSetgetTimestamp in class org.apache.derby.vti.VTITemplatejava.sql.SQLExceptionpublic java.sql.Timestamp getTimestamp(int i,
java.util.Calendar cal)
throws java.sql.SQLException
getTimestamp in interface java.sql.ResultSetgetTimestamp in class org.apache.derby.vti.VTITemplatejava.sql.SQLExceptionpublic void initScan(java.lang.String[] columnNames,
org.apache.derby.vti.Restriction restriction)
throws java.sql.SQLException
initScan in interface org.apache.derby.vti.RestrictedVTIjava.sql.SQLExceptionprivate static java.sql.Connection getDerbyConnection()
throws java.sql.SQLException
java.sql.SQLExceptionprivate 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.SQLExceptionprivate int mapColumnNumber(int derbyNumber)
Map a 1-based Derby column number to a 1-based column number in the query.
protected java.sql.SQLException notImplemented(java.lang.String arg0)
Apache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.