- java.lang.Object
-
- org.postgresql.pljava.jdbc.AbstractResultSet
-
- org.postgresql.pljava.jdbc.ObjectResultSet
-
- org.postgresql.pljava.jdbc.ReadOnlyResultSet
-
- org.postgresql.pljava.jdbc.ResultSetBase
-
- org.postgresql.pljava.jdbc.SPIResultSet
-
- All Implemented Interfaces:
AutoCloseable
,ResultSet
,Wrapper
public class SPIResultSet extends ResultSetBase
A Read-only ResultSet that provides direct access to aPortal
. At present, only forward positioning is implemented. Attempts to use reverse or absolute positioning will fail.- Author:
- Thomas Hallgren
-
-
Field Summary
-
Fields inherited from interface java.sql.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
-
-
Method Summary
Modifier and Type Method Description void
close()
int
findColumn(String columnName)
protected Tuple
getCurrentRow()
String
getCursorName()
This method does return the name of the portal, but beware of attempting positioned update/delete, because rows are read from the portal inResultSetBase.getFetchSize()
batches.ResultSetMetaData
getMetaData()
Returns anSPIResultSetMetaData
instance.protected Object
getObjectValue(int columnIndex, Class<?> type)
Implemented overTuple.getObject(TupleDesc,int,Class)
.protected Portal
getPortal()
Return thePortal
associated with thisResultSet
.Statement
getStatement()
Returns null if not overridden in a subclass.protected TupleTable
getTupleTable()
Get a(nother) table ofResultSetBase.getFetchSize()
rows from thePortal
.boolean
isLast()
boolean
next()
protected Tuple
peekNext()
Get anotherTuple
from theTupleTable
, refreshing the table as needed.-
Methods inherited from class org.postgresql.pljava.jdbc.ResultSetBase
absolute, afterLast, beforeFirst, first, getFetchDirection, getFetchSize, getHoldability, getRow, getType, isAfterLast, isBeforeFirst, isClosed, isFirst, last, previous, relative, setFetchDirection, setFetchSize
-
Methods inherited from class org.postgresql.pljava.jdbc.ReadOnlyResultSet
cancelRowUpdates, deleteRow, getConcurrency, insertRow, moveToCurrentRow, moveToInsertRow, rowDeleted, rowInserted, rowUpdated, updateObject, updateObject, updateRow
-
Methods inherited from class org.postgresql.pljava.jdbc.ObjectResultSet
clearWarnings, getArray, getAsciiStream, getBigDecimal, getBigDecimal, getBinaryStream, getBlob, getBoolean, getByte, getBytes, getCharacterStream, getClob, getDate, getDate, getDouble, getFloat, getInt, getLong, getNumber, getObject, getObject, getObject, getObjectValue, getObjectValue, getRef, getShort, getString, getTime, getTime, getTimestamp, getTimestamp, getUnicodeStream, getURL, getValue, getValue, getWarnings, refreshRow, updateArray, updateAsciiStream, updateBigDecimal, updateBinaryStream, updateBlob, updateBoolean, updateByte, updateBytes, updateCharacterStream, updateClob, updateDate, updateDouble, updateFloat, updateInt, updateLong, updateNull, updateRef, updateShort, updateString, updateTime, updateTimestamp, wasNull
-
Methods inherited from class org.postgresql.pljava.jdbc.AbstractResultSet
getArray, getAsciiStream, getBigDecimal, getBigDecimal, getBinaryStream, getBlob, getBoolean, getByte, getBytes, getCharacterStream, getClob, getDate, getDate, getDouble, getFloat, getInt, getLong, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getRef, getRowId, getRowId, getShort, getSQLXML, getSQLXML, getString, getTime, getTime, getTimestamp, getTimestamp, getUnicodeStream, getURL, isWrapperFor, unwrap, updateArray, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBoolean, updateByte, updateBytes, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateClob, updateClob, updateClob, updateDate, updateDouble, updateFloat, updateInt, updateLong, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNString, updateNString, updateNull, updateObject, updateObject, updateRef, updateRowId, updateRowId, updateShort, updateSQLXML, updateSQLXML, updateString, updateTime, updateTimestamp
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.sql.ResultSet
updateObject, updateObject, updateObject, updateObject
-
-
-
-
Method Detail
-
close
public void close() throws SQLException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceResultSet
- Overrides:
close
in classResultSetBase
- Throws:
SQLException
-
isLast
public boolean isLast() throws SQLException
- Throws:
SQLException
-
next
public boolean next() throws SQLException
- Throws:
SQLException
-
getCursorName
public String getCursorName() throws SQLException
This method does return the name of the portal, but beware of attempting positioned update/delete, because rows are read from the portal inResultSetBase.getFetchSize()
batches.- Specified by:
getCursorName
in interfaceResultSet
- Overrides:
getCursorName
in classAbstractResultSet
- Throws:
SQLException
-
findColumn
public int findColumn(String columnName) throws SQLException
- Throws:
SQLException
-
getStatement
public Statement getStatement() throws SQLException
Description copied from class:AbstractResultSet
Returns null if not overridden in a subclass.- Specified by:
getStatement
in interfaceResultSet
- Overrides:
getStatement
in classAbstractResultSet
- Throws:
SQLException
-
getPortal
protected final Portal getPortal() throws SQLException
Return thePortal
associated with thisResultSet
.- Throws:
SQLException
-
getTupleTable
protected final TupleTable getTupleTable() throws SQLException
Get a(nother) table ofResultSetBase.getFetchSize()
rows from thePortal
.- Throws:
SQLException
-
getCurrentRow
protected final Tuple getCurrentRow() throws SQLException
- Throws:
SQLException
-
peekNext
protected final Tuple peekNext() throws SQLException
Get anotherTuple
from theTupleTable
, refreshing the table as needed.- Throws:
SQLException
-
getObjectValue
protected Object getObjectValue(int columnIndex, Class<?> type) throws SQLException
Implemented overTuple.getObject(TupleDesc,int,Class)
.- Specified by:
getObjectValue
in classObjectResultSet
- Throws:
SQLException
-
getMetaData
public ResultSetMetaData getMetaData() throws SQLException
Returns anSPIResultSetMetaData
instance.- Specified by:
getMetaData
in interfaceResultSet
- Overrides:
getMetaData
in classObjectResultSet
- Throws:
SQLException
- indicating that this feature is not supported.
-
-