- java.lang.Object
-
- org.postgresql.pljava.internal.Portal
-
public class Portal extends Object
ThePortal
correspons to the internal PostgreSQLPortal
type.- Author:
- Thomas Hallgren
-
-
Method Summary
Modifier and Type Method Description void
close()
Invalidates this structure and frees up memory using the internal functionSPI_cursor_close
long
fetch(boolean forward, long count)
Performs anSPI_cursor_fetch
.String
getName()
Returns the name of this Portal.long
getPortalPos()
Returns the value of theportalPos
attribute.TupleDesc
getTupleDesc()
Returns the TupleDesc that describes the row Tuples for this Portal.boolean
isAtEnd()
Returns the value of theatEnd
attribute.boolean
isAtStart()
Returns the value of theatStart
attribute.long
move(boolean forward, long count)
Performs anSPI_cursor_move
.
-
-
-
Method Detail
-
close
public void close()
Invalidates this structure and frees up memory using the internal functionSPI_cursor_close
-
getName
public String getName() throws SQLException
Returns the name of this Portal.- Throws:
SQLException
- if the handle to the native structure is stale.
-
getPortalPos
public long getPortalPos() throws SQLException
Returns the value of theportalPos
attribute.- Throws:
SQLException
- if the handle to the native structure is stale.
-
getTupleDesc
public TupleDesc getTupleDesc() throws SQLException
Returns the TupleDesc that describes the row Tuples for this Portal.- Throws:
SQLException
- if the handle to the native structure is stale.
-
fetch
public long fetch(boolean forward, long count) throws SQLException
Performs anSPI_cursor_fetch
.The fetched rows are parked at the C global
SPI_tuptable
; seeSPI.getTupTable
for retrieving them. (While faithful to the way the C API works, this seems a bit odd as a Java API, and suggests that calls to this method and thenSPI.getTupTable
would ideally be done inside a singledoInPG
.)- Parameters:
forward
- Set totrue
for forward,false
for backward.count
- Maximum number of rows to fetch.- Returns:
- The actual number of fetched rows.
- Throws:
SQLException
- if the handle to the native structure is stale.
-
isAtEnd
public boolean isAtEnd() throws SQLException
Returns the value of theatEnd
attribute.- Throws:
SQLException
- if the handle to the native structure is stale.
-
isAtStart
public boolean isAtStart() throws SQLException
Returns the value of theatStart
attribute.- Throws:
SQLException
- if the handle to the native structure is stale.
-
move
public long move(boolean forward, long count) throws SQLException
Performs anSPI_cursor_move
.- Parameters:
forward
- Set totrue
for forward,false
for backward.count
- Maximum number of rows to fetch.- Returns:
- The actual number of rows moved.
- Throws:
SQLException
- if the handle to the native structure is stale.
-
-