java.lang.Object
org.postgresql.pljava.internal.Portal
- All Implemented Interfaces:
AutoCloseable
,Portal
The
Portal
correspons to the internal PostgreSQL
Portal
type.- Author:
- Thomas Hallgren
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.postgresql.pljava.model.Portal
Portal.Direction
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Invalidates this structure and frees up memory using the internal functionSPI_cursor_close
long
fetch
(boolean forward, long count) Performs anSPI_cursor_fetch
.fetch
(Portal.Direction dir, long count) getName()
Returns the name of this Portal.long
Returns the value of theportalPos
attribute.Returns the TupleDesc that describes the row Tuples for this Portal.boolean
isAtEnd()
Returns the value of theatEnd
attribute.boolean
Returns the value of theatStart
attribute.long
move
(boolean forward, long count) Performs anSPI_cursor_move
.long
move
(Portal.Direction dir, long count) Returns theTupleDescriptor
that describes the row tuples for thisPortal
.
-
Method Details
-
close
public void close()Invalidates this structure and frees up memory using the internal functionSPI_cursor_close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfacePortal
-
tupleDescriptor
Returns theTupleDescriptor
that describes the row tuples for thisPortal
.- Specified by:
tupleDescriptor
in interfacePortal
- Throws:
SQLException
- if the handle to the native structure is stale.
-
fetch
- Specified by:
fetch
in interfacePortal
- Throws:
SQLException
-
move
- Specified by:
move
in interfacePortal
- Throws:
SQLException
-
getName
Returns the name of this Portal.- Throws:
SQLException
- if the handle to the native structure is stale.
-
getPortalPos
Returns the value of theportalPos
attribute.- Throws:
SQLException
- if the handle to the native structure is stale.
-
getTupleDesc
Returns the TupleDesc that describes the row Tuples for this Portal.- Throws:
SQLException
- if the handle to the native structure is stale.
-
fetch
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
Returns the value of theatEnd
attribute.- Throws:
SQLException
- if the handle to the native structure is stale.
-
isAtStart
Returns the value of theatStart
attribute.- Throws:
SQLException
- if the handle to the native structure is stale.
-
move
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.
-