クラス PgStatement
- すべての実装されたインタフェース:
AutoCloseable
,Statement
,Wrapper
,BaseStatement
,PGStatement
-
ネストされたクラスの概要
ネストされたクラス修飾子とタイプクラス説明class
ResultHandler implementations for updates, queries, and either-or. -
フィールドの概要
フィールド修飾子とタイプフィールド説明protected boolean
protected @Nullable ArrayList<@Nullable ParameterList>
protected final int
protected final PgConnection
protected int
protected int
Number of rows to get in a batch.protected @Nullable @GuardedBy("<self>") ResultWrapper
The first unclosed result.protected @Nullable ResultWrapper
Results returned by a statement that wants generated keys.protected final ResourceLock
protected int
protected int
Maximum number of rows to return, 0 = unlimited.protected int
protected boolean
protected @Nullable ResultWrapper
The current results.protected final int
protected long
Timeout (in milliseconds) for a query.boolean
Was this PreparedStatement created to return generated keys for every execution?protected boolean
Does the caller of execute/executeUpdate want generated keys for this execution?protected @Nullable org.postgresql.jdbc.PSQLWarningWrapper
The warnings chain.インタフェースから継承されたフィールド org.postgresql.PGStatement
DATE_NEGATIVE_INFINITY, DATE_NEGATIVE_SMALLER_INFINITY, DATE_POSITIVE_INFINITY, DATE_POSITIVE_SMALLER_INFINITY
インタフェースから継承されたフィールド java.sql.Statement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO
-
メソッドの概要
修飾子とタイプメソッド説明void
void
addWarning
(SQLWarning warn) Either initializes new warning wrapper, or adds warning onto the chain.void
cancel()
protected void
protected void
protected final void
void
void
Clears the warning chain.final void
close()
Note: even thoughStatement
is automatically closed when it is garbage collected, it is better to close it explicitly to lower resource consumption.protected void
protected void
This is guaranteed to be called exactly once even in case of concurrentclose()
calls.void
protected BatchResultHandler
createBatchHandler
(Query[] queries, @Nullable ParameterList[] parameterLists) createDriverResultSet
(Field[] fields, List<Tuple> tuples) Create a synthetic resultset from data provided by the driver.createResultSet
(@Nullable Query originalQuery, Field[] fields, List<Tuple> tuples, @Nullable ResultCursor cursor) Create a resultset from data retrieved from the server.boolean
boolean
boolean
boolean
protected final void
execute
(CachedQuery cachedQuery, @Nullable ParameterList queryParameters, int flags) int[]
long[]
long
executeLargeUpdate
(String sql) long
executeLargeUpdate
(String sql, int autoGeneratedKeys) long
executeLargeUpdate
(String sql, int[] columnIndexes) long
executeLargeUpdate
(String sql, String @Nullable [] columnNames) executeQuery
(String sql) int
executeUpdate
(String sql) int
executeUpdate
(String sql, int autoGeneratedKeys) int
executeUpdate
(String sql, int[] columnIndexes) int
executeUpdate
(String sql, String @Nullable [] columnNames) boolean
executeWithFlags
(int flags) Execute a prepared query, passing additional query flags.boolean
executeWithFlags
(String sql, int flags) Execute a query, passing additional query flags.boolean
executeWithFlags
(CachedQuery simpleQuery, int flags) Execute a query, passing additional query flags.boolean
Get state of adaptive fetch for statement.int
@Nullable String
@org.checkerframework.checker.index.qual.NonNegative int
protected boolean
long
long
long
Returns the Last inserted/updated oid.int
int
boolean
boolean
getMoreResults
(int current) int
Gets the server-side prepare reuse threshold in use for this statement.int
long
The queryTimeout limit is the number of milliseconds the driver will wait for a Statement to execute.@Nullable ResultSet
int
int
int
protected ResultSet
protected TimestampUtils
int
@Nullable SQLWarning
boolean
isClosed()
boolean
protected boolean
isOneShotQuery
(@Nullable CachedQuery cachedQuery) Returns true if query is unlikely to be reused.boolean
boolean
Checks if this statement will be executed as a server-prepared statement.boolean
isWrapperFor
(Class<?> iface) void
setAdaptiveFetch
(boolean adaptiveFetch) Turn on/off adaptive fetch for statement.void
setCursorName
(String name) void
setEscapeProcessing
(boolean enable) void
setFetchDirection
(int direction) void
setFetchSize
(@org.checkerframework.checker.index.qual.NonNegative int rows) void
setLargeMaxRows
(long max) void
setMaxFieldSize
(int max) void
setMaxRows
(int max) void
setPoolable
(boolean poolable) void
setPrepareThreshold
(int newThreshold) Sets the reuse threshold for using server-prepared statements.void
setQueryTimeout
(int seconds) void
setQueryTimeoutMs
(long millis) Sets the queryTimeout limit.void
setUseServerPrepare
(boolean flag) 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)
.protected void
<T> T
protected boolean
protected boolean
クラスから継承されたメソッド java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
インタフェースから継承されたメソッド java.sql.Statement
enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, isSimpleIdentifier
-
フィールド詳細
-
lock
-
batchStatements
-
batchParameters
-
resultsettype
protected final int resultsettype -
concurrency
protected final int concurrency -
fetchdirection
protected int fetchdirection -
wantsGeneratedKeysOnce
protected boolean wantsGeneratedKeysOnceDoes the caller of execute/executeUpdate want generated keys for this execution? This is set by Statement methods that have generated keys arguments and cleared after execution is complete. -
wantsGeneratedKeysAlways
public boolean wantsGeneratedKeysAlwaysWas this PreparedStatement created to return generated keys for every execution? This is set at creation time and never cleared by execution. -
connection
-
warnings
protected volatile @Nullable org.postgresql.jdbc.PSQLWarningWrapper warningsThe warnings chain. -
maxrows
protected int maxrowsMaximum number of rows to return, 0 = unlimited. -
fetchSize
protected int fetchSizeNumber of rows to get in a batch. -
timeout
protected long timeoutTimeout (in milliseconds) for a query. -
replaceProcessingEnabled
protected boolean replaceProcessingEnabled -
result
The current results. -
firstUnclosedResult
The first unclosed result. -
generatedKeys
Results returned by a statement that wants generated keys. -
mPrepareThreshold
protected int mPrepareThreshold -
maxFieldSize
protected int maxFieldSize -
adaptiveFetch
protected boolean adaptiveFetch
-
-
メソッドの詳細
-
createResultSet
public ResultSet createResultSet(@Nullable Query originalQuery, Field[] fields, List<Tuple> tuples, @Nullable ResultCursor cursor) throws SQLException インタフェースからコピーされた説明:BaseStatement
Create a resultset from data retrieved from the server.- 定義:
createResultSet
インタフェース内BaseStatement
- パラメータ:
originalQuery
- the query that generated this resultset; used when dealing with updateable resultsetsfields
- the column metadata for the resultsettuples
- the resultset datacursor
- the cursor to use to retrieve more data from the server; if null, no additional data is present.- 戻り値:
- the new ResultSet
- 例外:
SQLException
- if something goes wrong
-
getPGConnection
-
getFetchingCursorName
-
getFetchSize
public @org.checkerframework.checker.index.qual.NonNegative int getFetchSize()- 定義:
getFetchSize
インタフェース内Statement
-
wantsScrollableResultSet
protected boolean wantsScrollableResultSet() -
wantsHoldableResultSet
protected boolean wantsHoldableResultSet() -
executeQuery
- 定義:
executeQuery
インタフェース内Statement
- 例外:
SQLException
-
getSingleResultSet
- 例外:
SQLException
-
executeUpdate
- 定義:
executeUpdate
インタフェース内Statement
- 例外:
SQLException
-
checkNoResultUpdate
- 例外:
SQLException
-
execute
- 定義:
execute
インタフェース内Statement
- 例外:
SQLException
-
executeWithFlags
インタフェースからコピーされた説明:BaseStatement
Execute a query, passing additional query flags.- 定義:
executeWithFlags
インタフェース内BaseStatement
- パラメータ:
sql
- the query to execute (JDBC-style query)flags
- additionalQueryExecutor
flags for execution; these are bitwise-ORed into the default flags.- 戻り値:
- true if there is a result set
- 例外:
SQLException
- if something goes wrong.
-
executeWithFlags
インタフェースからコピーされた説明:BaseStatement
Execute a query, passing additional query flags.- 定義:
executeWithFlags
インタフェース内BaseStatement
- パラメータ:
simpleQuery
- the query to execute (native to PostgreSQL)flags
- additionalQueryExecutor
flags for execution; these are bitwise-ORed into the default flags.- 戻り値:
- true if there is a result set
- 例外:
SQLException
- if something goes wrong.
-
executeWithFlags
インタフェースからコピーされた説明:BaseStatement
Execute a prepared query, passing additional query flags.- 定義:
executeWithFlags
インタフェース内BaseStatement
- パラメータ:
flags
- additionalQueryExecutor
flags for execution; these are bitwise-ORed into the default flags.- 戻り値:
- true if there is a result set
- 例外:
SQLException
- if something goes wrong.
-
closeForNextExecution
- 例外:
SQLException
-
isOneShotQuery
Returns true if query is unlikely to be reused.- パラメータ:
cachedQuery
- to check (null if current query)- 戻り値:
- true if query is unlikely to be reused
-
execute
protected final void execute(CachedQuery cachedQuery, @Nullable ParameterList queryParameters, int flags) throws SQLException - 例外:
SQLException
-
setCursorName
- 定義:
setCursorName
インタフェース内Statement
- 例外:
SQLException
-
getUpdateCount
- 定義:
getUpdateCount
インタフェース内Statement
- 例外:
SQLException
-
getMoreResults
- 定義:
getMoreResults
インタフェース内Statement
- 例外:
SQLException
-
getMaxRows
- 定義:
getMaxRows
インタフェース内Statement
- 例外:
SQLException
-
setMaxRows
- 定義:
setMaxRows
インタフェース内Statement
- 例外:
SQLException
-
setEscapeProcessing
- 定義:
setEscapeProcessing
インタフェース内Statement
- 例外:
SQLException
-
getQueryTimeout
- 定義:
getQueryTimeout
インタフェース内Statement
- 例外:
SQLException
-
setQueryTimeout
- 定義:
setQueryTimeout
インタフェース内Statement
- 例外:
SQLException
-
getQueryTimeoutMs
The queryTimeout limit is the number of milliseconds the driver will wait for a Statement to execute. If the limit is exceeded, a SQLException is thrown.- 戻り値:
- the current query timeout limit in milliseconds; 0 = unlimited
- 例外:
SQLException
- if a database access error occurs
-
setQueryTimeoutMs
Sets the queryTimeout limit.- パラメータ:
millis
- - the new query timeout limit in milliseconds- 例外:
SQLException
- if a database access error occurs
-
addWarning
Either initializes new warning wrapper, or adds warning onto the chain.
Although warnings are expected to be added sequentially, the warnings chain may be cleared concurrently at any time via
clearWarnings()
, therefore it is possible that a warning added via this method is placed onto the end of the previous warning chain- パラメータ:
warn
- warning to add
-
getWarnings
- 定義:
getWarnings
インタフェース内Statement
- 例外:
SQLException
-
getMaxFieldSize
- 定義:
getMaxFieldSize
インタフェース内Statement
- 例外:
SQLException
-
setMaxFieldSize
- 定義:
setMaxFieldSize
インタフェース内Statement
- 例外:
SQLException
-
clearWarnings
Clears the warning chain.
Note that while it is safe to clear warnings while the query is executing, warnings that are added between calls to
getWarnings()
and #clearWarnings() may be missed. Therefore you should hold a reference to the tail of the previous warning chain and verify if itsSQLWarning.getNextWarning()
value is holds any new value.- 定義:
clearWarnings
インタフェース内Statement
- 例外:
SQLException
-
getResultSet
- 定義:
getResultSet
インタフェース内Statement
- 例外:
SQLException
-
close
Note: even thoughStatement
is automatically closed when it is garbage collected, it is better to close it explicitly to lower resource consumption.- 定義:
close
インタフェース内AutoCloseable
- 定義:
close
インタフェース内Statement
- 例外:
SQLException
-
closeImpl
This is guaranteed to be called exactly once even in case of concurrentclose()
calls.- 例外:
SQLException
- in case of error
-
getLastOID
インタフェースからコピーされた説明:PGStatement
Returns the Last inserted/updated oid.- 定義:
getLastOID
インタフェース内PGStatement
- 戻り値:
- OID of last insert
- 例外:
SQLException
- if something goes wrong
-
setPrepareThreshold
インタフェースからコピーされた説明:PGStatement
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.
- 定義:
setPrepareThreshold
インタフェース内PGStatement
- パラメータ:
newThreshold
- the new threshold for this statement- 例外:
SQLException
- if an exception occurs while changing the threshold
-
getPrepareThreshold
public int getPrepareThreshold()インタフェースからコピーされた説明:PGStatement
Gets the server-side prepare reuse threshold in use for this statement.- 定義:
getPrepareThreshold
インタフェース内PGStatement
- 戻り値:
- the current threshold
- 関連項目:
-
setUseServerPrepare
インタフェースからコピーされた説明:PGStatement
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)
.- 定義:
setUseServerPrepare
インタフェース内PGStatement
- パラメータ:
flag
- use server prepare- 例外:
SQLException
- if something goes wrong
-
isUseServerPrepare
public boolean isUseServerPrepare()インタフェースからコピーされた説明:PGStatement
Checks if this statement will be executed as a server-prepared statement. A return value oftrue
indicates that the next execution of the statement will be done as a server-prepared statement, assuming the underlying protocol supports it.- 定義:
isUseServerPrepare
インタフェース内PGStatement
- 戻り値:
- true if the next reuse of this statement will use a server-prepared statement
-
checkClosed
- 例外:
SQLException
-
addBatch
- 定義:
addBatch
インタフェース内Statement
- 例外:
SQLException
-
clearBatch
- 定義:
clearBatch
インタフェース内Statement
- 例外:
SQLException
-
createBatchHandler
protected BatchResultHandler createBatchHandler(Query[] queries, @Nullable ParameterList[] parameterLists) -
executeBatch
- 定義:
executeBatch
インタフェース内Statement
- 例外:
SQLException
-
cancel
- 定義:
cancel
インタフェース内Statement
- 例外:
SQLException
-
getConnection
- 定義:
getConnection
インタフェース内Statement
- 例外:
SQLException
-
getFetchDirection
public int getFetchDirection()- 定義:
getFetchDirection
インタフェース内Statement
-
getResultSetConcurrency
public int getResultSetConcurrency()- 定義:
getResultSetConcurrency
インタフェース内Statement
-
getResultSetType
public int getResultSetType()- 定義:
getResultSetType
インタフェース内Statement
-
setFetchDirection
- 定義:
setFetchDirection
インタフェース内Statement
- 例外:
SQLException
-
setFetchSize
public void setFetchSize(@org.checkerframework.checker.index.qual.NonNegative int rows) throws SQLException - 定義:
setFetchSize
インタフェース内Statement
- 例外:
SQLException
-
getForceBinaryTransfer
protected boolean getForceBinaryTransfer() -
getLargeUpdateCount
- 定義:
getLargeUpdateCount
インタフェース内Statement
- 例外:
SQLException
-
setLargeMaxRows
- 定義:
setLargeMaxRows
インタフェース内Statement
- 例外:
SQLException
-
getLargeMaxRows
- 定義:
getLargeMaxRows
インタフェース内Statement
- 例外:
SQLException
-
executeLargeBatch
- 定義:
executeLargeBatch
インタフェース内Statement
- 例外:
SQLException
-
executeLargeUpdate
- 定義:
executeLargeUpdate
インタフェース内Statement
- 例外:
SQLException
-
executeLargeUpdate
- 定義:
executeLargeUpdate
インタフェース内Statement
- 例外:
SQLException
-
executeLargeUpdate
- 定義:
executeLargeUpdate
インタフェース内Statement
- 例外:
SQLException
-
executeLargeUpdate
- 定義:
executeLargeUpdate
インタフェース内Statement
- 例外:
SQLException
-
isClosed
- 定義:
isClosed
インタフェース内Statement
- 例外:
SQLException
-
setPoolable
- 定義:
setPoolable
インタフェース内Statement
- 例外:
SQLException
-
isPoolable
- 定義:
isPoolable
インタフェース内Statement
- 例外:
SQLException
-
isWrapperFor
- 定義:
isWrapperFor
インタフェース内Wrapper
- 例外:
SQLException
-
unwrap
- 定義:
unwrap
インタフェース内Wrapper
- 例外:
SQLException
-
closeOnCompletion
- 定義:
closeOnCompletion
インタフェース内Statement
- 例外:
SQLException
-
isCloseOnCompletion
- 定義:
isCloseOnCompletion
インタフェース内Statement
- 例外:
SQLException
-
checkCompletion
- 例外:
SQLException
-
getMoreResults
- 定義:
getMoreResults
インタフェース内Statement
- 例外:
SQLException
-
getGeneratedKeys
- 定義:
getGeneratedKeys
インタフェース内Statement
- 例外:
SQLException
-
executeUpdate
- 定義:
executeUpdate
インタフェース内Statement
- 例外:
SQLException
-
executeUpdate
- 定義:
executeUpdate
インタフェース内Statement
- 例外:
SQLException
-
executeUpdate
- 定義:
executeUpdate
インタフェース内Statement
- 例外:
SQLException
-
execute
- 定義:
execute
インタフェース内Statement
- 例外:
SQLException
-
execute
- 定義:
execute
インタフェース内Statement
- 例外:
SQLException
-
execute
- 定義:
execute
インタフェース内Statement
- 例外:
SQLException
-
getResultSetHoldability
- 定義:
getResultSetHoldability
インタフェース内Statement
- 例外:
SQLException
-
createDriverResultSet
インタフェースからコピーされた説明:BaseStatement
Create a synthetic resultset from data provided by the driver.- 定義:
createDriverResultSet
インタフェース内BaseStatement
- パラメータ:
fields
- the column metadata for the resultsettuples
- the resultset data- 戻り値:
- the new ResultSet
- 例外:
SQLException
- if something goes wrong
-
transformQueriesAndParameters
- 例外:
SQLException
-
setAdaptiveFetch
public void setAdaptiveFetch(boolean adaptiveFetch) インタフェースからコピーされた説明:PGStatement
Turn on/off adaptive fetch for statement. Existing resultSets won't be affected by change here.- 定義:
setAdaptiveFetch
インタフェース内PGStatement
- パラメータ:
adaptiveFetch
- desired state of adaptive fetch.
-
getAdaptiveFetch
public boolean getAdaptiveFetch()インタフェースからコピーされた説明:PGStatement
Get state of adaptive fetch for statement.- 定義:
getAdaptiveFetch
インタフェース内PGStatement
- 戻り値:
- state of adaptive fetch (turned on or off)
-
getTimestampUtils
-