|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.postgresql.pljava.internal.NativeStruct
org.postgresql.pljava.internal.ExecutionPlan
The ExecutionPlan
correspons to the execution plan obtained
using an internal PostgreSQL SPI_prepare
call.
Constructor Summary | |
ExecutionPlan()
|
Method Summary | |
Portal |
cursorOpen(java.lang.String cursorName,
java.lang.Object[] parameters)
Set up a cursor that will execute the plan using the internal SPI_cursor_open function |
int |
execp(java.lang.Object[] parameters,
int rowCount)
Execute the plan using the internal SPI_execp function. |
void |
finalize()
Finalizers might run by a thread other then the main thread so instead of calling invalidate here we store the pointer on a "death row" that will be investegated by the main thread later on. |
void |
invalidate()
Invalidates this structure and frees up memory using the internal function SPI_freeplan |
boolean |
isCursorPlan()
Returns true if this ExecutionPlan can create
a Portal using cursorOpen(java.lang.String, java.lang.Object[]) . |
void |
makeDurable()
Make this plan durable. |
static ExecutionPlan |
prepare(java.lang.String statement,
Oid[] argTypes)
Create an execution plan for a statement to be executed later using the internal SPI_prepare function. |
Methods inherited from class org.postgresql.pljava.internal.NativeStruct |
getNative, isValid, releasePointer |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ExecutionPlan()
Method Detail |
public Portal cursorOpen(java.lang.String cursorName, java.lang.Object[] parameters) throws java.sql.SQLException
SPI_cursor_open
function
cursorName
- Name of the cursor or null
for a
system generated name.parameters
- Values for the parameters.
Portal
that represents the opened cursor.
java.sql.SQLException
- If the underlying native structure has gone stale.public boolean isCursorPlan() throws java.sql.SQLException
true
if this ExecutionPlan
can create
a Portal
using cursorOpen(java.lang.String, java.lang.Object[])
. This is true if the
plan contains only one regular SELECT
query.
java.sql.SQLException
- If the underlying native structure has gone stale.public int execp(java.lang.Object[] parameters, int rowCount) throws java.sql.SQLException
SPI_execp
function.
parameters
- Values for the parameters.rowCount
- The maximum number of tuples to create. A value
of rowCount
of zero is interpreted as no limit, i.e.,
run to completion.
SPI
.
java.sql.SQLException
- If the underlying native structure has gone stale.public static ExecutionPlan prepare(java.lang.String statement, Oid[] argTypes) throws java.sql.SQLException
SPI_prepare
function.
statement
- The command string.argTypes
- SQL types of argument types.
java.sql.SQLException
Types
public void invalidate()
SPI_freeplan
invalidate
in class NativeStruct
public void makeDurable() throws java.sql.SQLException
java.sql.SQLException
- If the underlying native structure has gone stale.public void finalize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |