public abstract class QueryExecutorBase extends Object implements QueryExecutor
Modifier and Type | Field and Description |
---|---|
protected PGStream |
pgStream |
QUERY_BOTH_ROWS_AND_STATUS, QUERY_DESCRIBE_ONLY, QUERY_DISALLOW_BATCHING, QUERY_EXECUTE_AS_SIMPLE, QUERY_FORCE_DESCRIBE_PORTAL, QUERY_FORWARD_CURSOR, QUERY_NO_BINARY_TRANSFER, QUERY_NO_METADATA, QUERY_NO_RESULTS, QUERY_ONESHOT, QUERY_SUPPRESS_BEGIN
Modifier | Constructor and Description |
---|---|
protected |
QueryExecutorBase(PGStream pgStream,
String user,
String database,
int cancelSignalTimeout,
Properties info) |
Modifier and Type | Method and Description |
---|---|
void |
abort()
Abort at network level without sending the Terminate message to the backend.
|
void |
addNotification(PGNotification notification) |
void |
addWarning(SQLWarning newWarning) |
CachedQuery |
borrowCallableQuery(String sql) |
CachedQuery |
borrowQuery(String sql) |
CachedQuery |
borrowQueryByKey(Object key) |
CachedQuery |
borrowReturningQuery(String sql,
String[] columnNames) |
void |
close()
Close this connection cleanly.
|
CachedQuery |
createQuery(String sql,
boolean escapeProcessing,
boolean isParameterized,
String... columnNames) |
CachedQuery |
createQueryByKey(Object key) |
Object |
createQueryKey(String sql,
boolean escapeProcessing,
boolean isParameterized,
String... columnNames) |
AutoSave |
getAutoSave() |
int |
getBackendPID()
Return the process ID (PID) of the backend server process handling this connection.
|
String |
getDatabase() |
Encoding |
getEncoding() |
HostSpec |
getHostSpec() |
PGNotification[] |
getNotifications()
Retrieve and clear the set of asynchronous notifications pending on this connection.
|
PreferQueryMode |
getPreferQueryMode() |
String |
getServerVersion()
Return the server version from the server_version GUC.
|
int |
getServerVersionNum()
Get a machine-readable server version.
|
boolean |
getStandardConformingStrings()
Returns whether the server treats string-literals according to the SQL standard or if it uses
traditional PostgreSQL escaping rules.
|
TransactionState |
getTransactionState()
Get the current transaction state of this connection.
|
String |
getUser() |
SQLWarning |
getWarnings()
Retrieve and clear the chain of warnings accumulated on this connection.
|
protected boolean |
hasNotifications() |
boolean |
isClosed()
Check if this connection is closed.
|
boolean |
isColumnSanitiserDisabled() |
boolean |
isFlushCacheOnDeallocate() |
boolean |
isReWriteBatchedInsertsEnabled() |
void |
releaseQuery(CachedQuery cachedQuery) |
protected abstract void |
sendCloseMessage() |
void |
sendQueryCancel()
Sends a query cancellation for this connection.
|
void |
setAutoSave(AutoSave autoSave) |
void |
setBackendKeyData(int cancelPid,
int cancelKey) |
void |
setEncoding(Encoding encoding) |
void |
setFlushCacheOnDeallocate(boolean flushCacheOnDeallocate)
By default, the connection resets statement cache in case deallocate all/discard all
message is observed.
|
void |
setServerVersion(String serverVersion) |
void |
setServerVersionNum(int serverVersionNum) |
void |
setStandardConformingStrings(boolean value) |
void |
setTransactionState(TransactionState state) |
boolean |
willHealOnRetry(SQLException e) |
protected boolean |
willHealViaReparse(SQLException e) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createFastpathParameters, createSimpleQuery, execute, execute, fastpathCall, fetch, getApplicationName, getIntegerDateTimes, getProtocolVersion, getReplicationProtocol, getTimeZone, processNotifies, processNotifies, setBinaryReceiveOids, setBinarySendOids, startCopy, wrap
useBinaryForReceive, useBinaryForSend
protected final PGStream pgStream
protected QueryExecutorBase(PGStream pgStream, String user, String database, int cancelSignalTimeout, Properties info) throws SQLException
SQLException
protected abstract void sendCloseMessage() throws IOException
IOException
public HostSpec getHostSpec()
getHostSpec
in interface QueryExecutor
public String getUser()
getUser
in interface QueryExecutor
public String getDatabase()
getDatabase
in interface QueryExecutor
public void setBackendKeyData(int cancelPid, int cancelKey)
public int getBackendPID()
QueryExecutor
getBackendPID
in interface QueryExecutor
public void abort()
QueryExecutor
abort
in interface QueryExecutor
public void close()
QueryExecutor
close
in interface QueryExecutor
public boolean isClosed()
QueryExecutor
isClosed
in interface QueryExecutor
public void sendQueryCancel() throws SQLException
QueryExecutor
sendQueryCancel
in interface QueryExecutor
SQLException
- if something goes wrong.public void addWarning(SQLWarning newWarning)
public void addNotification(PGNotification notification)
public PGNotification[] getNotifications() throws SQLException
QueryExecutor
getNotifications
in interface QueryExecutor
SQLException
- if and error occurs while fetching notificationspublic SQLWarning getWarnings()
QueryExecutor
getWarnings
in interface QueryExecutor
public String getServerVersion()
QueryExecutor
getServerVersion
in interface QueryExecutor
public int getServerVersionNum()
QueryExecutor
getServerVersionNum
in interface QueryExecutor
public void setServerVersion(String serverVersion)
public void setServerVersionNum(int serverVersionNum)
public void setTransactionState(TransactionState state)
public void setStandardConformingStrings(boolean value)
public boolean getStandardConformingStrings()
QueryExecutor
getStandardConformingStrings
in interface QueryExecutor
public TransactionState getTransactionState()
QueryExecutor
getTransactionState
in interface QueryExecutor
public void setEncoding(Encoding encoding) throws IOException
IOException
public Encoding getEncoding()
getEncoding
in interface QueryExecutor
public boolean isReWriteBatchedInsertsEnabled()
isReWriteBatchedInsertsEnabled
in interface QueryExecutor
public final CachedQuery borrowQuery(String sql) throws SQLException
borrowQuery
in interface QueryExecutor
SQLException
public final CachedQuery borrowCallableQuery(String sql) throws SQLException
borrowCallableQuery
in interface QueryExecutor
SQLException
public final CachedQuery borrowReturningQuery(String sql, String[] columnNames) throws SQLException
borrowReturningQuery
in interface QueryExecutor
SQLException
public CachedQuery borrowQueryByKey(Object key) throws SQLException
borrowQueryByKey
in interface QueryExecutor
SQLException
public void releaseQuery(CachedQuery cachedQuery)
releaseQuery
in interface QueryExecutor
public final Object createQueryKey(String sql, boolean escapeProcessing, boolean isParameterized, String... columnNames)
createQueryKey
in interface QueryExecutor
public CachedQuery createQueryByKey(Object key) throws SQLException
createQueryByKey
in interface QueryExecutor
SQLException
public final CachedQuery createQuery(String sql, boolean escapeProcessing, boolean isParameterized, String... columnNames) throws SQLException
createQuery
in interface QueryExecutor
SQLException
public boolean isColumnSanitiserDisabled()
isColumnSanitiserDisabled
in interface QueryExecutor
public PreferQueryMode getPreferQueryMode()
getPreferQueryMode
in interface QueryExecutor
public AutoSave getAutoSave()
getAutoSave
in interface QueryExecutor
public void setAutoSave(AutoSave autoSave)
setAutoSave
in interface QueryExecutor
protected boolean willHealViaReparse(SQLException e)
public boolean willHealOnRetry(SQLException e)
willHealOnRetry
in interface QueryExecutor
public boolean isFlushCacheOnDeallocate()
public void setFlushCacheOnDeallocate(boolean flushCacheOnDeallocate)
QueryExecutor
setFlushCacheOnDeallocate
in interface QueryExecutor
flushCacheOnDeallocate
- true if statement cache should be reset when "deallocate/discard" message observedprotected boolean hasNotifications()
Copyright © 2017 PostgreSQL Global Development Group. All rights reserved.