Package org.postgresql
Interface PGStatement
-
- All Known Subinterfaces:
BaseStatement
- All Known Implementing Classes:
PgStatement
public interface PGStatementThis interface defines the public PostgreSQL extensions to java.sql.Statement. All Statements constructed by the PostgreSQL driver implement PGStatement.
-
-
Field Summary
Fields Modifier and Type Field Description static longDATE_NEGATIVE_INFINITYstatic longDATE_NEGATIVE_SMALLER_INFINITYstatic longDATE_POSITIVE_INFINITYstatic longDATE_POSITIVE_SMALLER_INFINITY
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description booleangetAdaptiveFetch()Get state of adaptive fetch for statement.longgetLastOID()Returns the Last inserted/updated oid.intgetPrepareThreshold()Gets the server-side prepare reuse threshold in use for this statement.booleanisUseServerPrepare()Checks if this statement will be executed as a server-prepared statement.voidsetAdaptiveFetch(boolean adaptiveFetch)Turn on/off adaptive fetch for statement.voidsetPrepareThreshold(int threshold)Sets the reuse threshold for using server-prepared statements.voidsetUseServerPrepare(boolean flag)Deprecated.As of build 302, replaced bysetPrepareThreshold(int)
-
-
-
Field Detail
-
DATE_POSITIVE_INFINITY
static final long DATE_POSITIVE_INFINITY
- See Also:
- Constant Field Values
-
DATE_NEGATIVE_INFINITY
static final long DATE_NEGATIVE_INFINITY
- See Also:
- Constant Field Values
-
DATE_POSITIVE_SMALLER_INFINITY
static final long DATE_POSITIVE_SMALLER_INFINITY
- See Also:
- Constant Field Values
-
DATE_NEGATIVE_SMALLER_INFINITY
static final long DATE_NEGATIVE_SMALLER_INFINITY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getLastOID
long getLastOID() throws java.sql.SQLExceptionReturns the Last inserted/updated oid.- Returns:
- OID of last insert
- Throws:
java.sql.SQLException- if something goes wrong- Since:
- 7.3
-
setUseServerPrepare
@Deprecated void setUseServerPrepare(boolean flag) throws java.sql.SQLExceptionDeprecated.As of build 302, replaced bysetPrepareThreshold(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 tosetPrepareThreshold(1).- Parameters:
flag- use server prepare- Throws:
java.sql.SQLException- if something goes wrong- Since:
- 7.3
-
isUseServerPrepare
boolean isUseServerPrepare()
Checks if this statement will be executed as a server-prepared statement. A return value oftrueindicates that the next execution of the statement will be done as a server-prepared statement, assuming the underlying protocol supports it.- Returns:
- true if the next reuse of this statement will use a server-prepared statement
-
setPrepareThreshold
void setPrepareThreshold(int threshold) throws java.sql.SQLExceptionSets the reuse threshold for using server-prepared statements.If
thresholdis a non-zero value N, the Nth and subsequent reuses of a PreparedStatement will use server-side prepare.If
thresholdis 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- the new threshold for this statement- Throws:
java.sql.SQLException- if an exception occurs while changing the threshold- Since:
- build 302
-
getPrepareThreshold
int getPrepareThreshold()
Gets the server-side prepare reuse threshold in use for this statement.- Returns:
- the current threshold
- Since:
- build 302
- See Also:
setPrepareThreshold(int)
-
setAdaptiveFetch
void setAdaptiveFetch(boolean adaptiveFetch)
Turn on/off adaptive fetch for statement. Existing resultSets won't be affected by change here.- Parameters:
adaptiveFetch- desired state of adaptive fetch.
-
getAdaptiveFetch
boolean getAdaptiveFetch()
Get state of adaptive fetch for statement.- Returns:
- state of adaptive fetch (turned on or off)
-
-