Top Description Fields Methods
org.postgresql

public Interface PGStatement

Known Direct Subinterfaces
org.postgresql.core.BaseStatement
Imports
java.sql.SQLException

This interface defines the public PostgreSQL extensions to java.sql.Statement. All Statements constructed by the PostgreSQL driver implement PGStatement.

Field Summary

Modifier and TypeField and Description
public static final long
public static final long
public static final long
public static final long

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

state of adaptive fetch (turned on or off)
getAdaptiveFetch
()

Get state of adaptive fetch for statement.

public long

Returns:

OID of last insert
getLastOID
()

Returns the Last inserted/updated oid.

public int

Returns:

the current threshold
getPrepareThreshold
()

Gets the server-side prepare reuse threshold in use for this statement.

public boolean

Returns:

true if the next reuse of this statement will use a server-prepared statement
isUseServerPrepare
()

Checks if this statement will be executed as a server-prepared statement.

public void
setAdaptiveFetch(boolean
desired state of adaptive fetch.
adaptiveFetch
)

Turn on/off adaptive fetch for statement.

public void
setPrepareThreshold(int
the new threshold for this statement
threshold
)

Sets the reuse threshold for using server-prepared statements.

public void
setUseServerPrepare(boolean
use server prepare
flag
)
Deprecated As of build 302, replaced by setPrepareThreshold(int)

Turn on the use of prepared statements in the server (server side prepared statements are unrelated to jdbc PreparedStatements) As of build 302, this method is equivalent to setPrepareThreshold(1).

Field Detail

DATE_NEGATIVE_INFINITYback to summary
public static final long DATE_NEGATIVE_INFINITY
DATE_NEGATIVE_SMALLER_INFINITYback to summary
public static final long DATE_NEGATIVE_SMALLER_INFINITY
DATE_POSITIVE_INFINITYback to summary
public static final long DATE_POSITIVE_INFINITY
DATE_POSITIVE_SMALLER_INFINITYback to summary
public static final long DATE_POSITIVE_SMALLER_INFINITY

Method Detail

getAdaptiveFetchback to summary
public boolean getAdaptiveFetch()

Get state of adaptive fetch for statement.

Returns:boolean

state of adaptive fetch (turned on or off)

getLastOIDback to summary
public long getLastOID() throws SQLException

Returns the Last inserted/updated oid.

Returns:long

OID of last insert

Exceptions
SQLException:
if something goes wrong
Since
7.3
getPrepareThresholdback to summary
public int getPrepareThreshold()

Gets the server-side prepare reuse threshold in use for this statement.

Returns:int

the current threshold

Since
build 302
See Also
setPrepareThreshold(int)
isUseServerPrepareback to summary
public boolean isUseServerPrepare()

Checks if this statement will be executed as a server-prepared statement. A return value of true indicates that the next execution of the statement will be done as a server-prepared statement, assuming the underlying protocol supports it.

Returns:boolean

true if the next reuse of this statement will use a server-prepared statement

setAdaptiveFetchback to summary
public void setAdaptiveFetch(boolean adaptiveFetch)

Turn on/off adaptive fetch for statement. Existing resultSets won't be affected by change here.

Parameters
adaptiveFetch:boolean

desired state of adaptive fetch.

setPrepareThresholdback to summary
public void setPrepareThreshold(int threshold) throws SQLException

Sets the reuse threshold for using server-prepared statements.

If threshold is a non-zero value N, the Nth and subsequent reuses of a PreparedStatement will use server-side prepare.

If threshold is zero, server-side prepare will not be used.

The reuse threshold is only used by PreparedStatement and CallableStatement objects; it is ignored for plain Statements.

Parameters
threshold:int

the new threshold for this statement

Exceptions
SQLException:
if an exception occurs while changing the threshold
Since
build 302
setUseServerPrepareback to summary
public void setUseServerPrepare(boolean flag) throws SQLException

Deprecated

As of build 302, replaced by setPrepareThreshold(int)

Turn on the use of prepared statements in the server (server side prepared statements are unrelated to jdbc PreparedStatements) As of build 302, this method is equivalent to setPrepareThreshold(1).

Parameters
flag:boolean

use server prepare

Annotations
@Deprecated
Exceptions
SQLException:
if something goes wrong
Since
7.3