public interface BaseConnection extends PGConnection, java.sql.Connection
| Modifier and Type | Method and Description |
|---|---|
void |
addTimerTask(java.util.TimerTask timerTask,
long milliSeconds)
Schedule a TimerTask for later execution.
|
boolean |
binaryTransferSend(int oid)
Returns true if value for the given oid should be sent using binary transfer.
|
void |
cancelQuery()
Cancel the current query executing on this connection.
|
CachedQuery |
createQuery(java.lang.String sql,
boolean escapeProcessing,
boolean isParameterized,
java.lang.String... columnNames) |
byte[] |
encodeString(java.lang.String str)
Encode a string using the database's client_encoding (usually UTF8, but can vary on older
server versions).
|
java.lang.String |
escapeString(java.lang.String str)
Escapes a string for use as string-literal within an SQL command.
|
java.sql.ResultSet |
execSQLQuery(java.lang.String s)
Execute a SQL query that returns a single resultset.
|
java.sql.ResultSet |
execSQLQuery(java.lang.String s,
int resultSetType,
int resultSetConcurrency) |
void |
execSQLUpdate(java.lang.String s)
Execute a SQL query that does not return results.
|
Encoding |
getEncoding() |
LruCache<FieldMetadata.Key,FieldMetadata> |
getFieldMetadataCache()
Return metadata cache for given connection.
|
java.util.logging.Logger |
getLogger() |
boolean |
getLogServerErrorDetail()
Indicates if error details from server used in included in logging and exceptions.
|
java.lang.Object |
getObject(java.lang.String type,
java.lang.String value,
byte[] byteValue)
Construct and return an appropriate object for the given type and value.
|
QueryExecutor |
getQueryExecutor()
Get the QueryExecutor implementation for this connection.
|
ReplicationProtocol |
getReplicationProtocol()
Internal protocol for work with physical and logical replication.
|
boolean |
getStandardConformingStrings()
Returns whether the server treats string-literals according to the SQL standard or if it uses
traditional PostgreSQL escaping rules.
|
boolean |
getStringVarcharFlag() |
TimestampUtils |
getTimestampUtils()
Deprecated.
|
TransactionState |
getTransactionState()
Get the current transaction state of this connection.
|
TypeInfo |
getTypeInfo() |
PGXmlFactoryFactory |
getXmlFactoryFactory()
Retrieve the factory to instantiate XML processing factories.
|
boolean |
haveMinimumServerVersion(int ver)
Check if we have at least a particular server version.
|
boolean |
haveMinimumServerVersion(Version ver)
Check if we have at least a particular server version.
|
boolean |
hintReadOnly()
Indicates if statements to backend should be hinted as read only.
|
boolean |
isColumnSanitiserDisabled()
Return whether to disable column name sanitation.
|
void |
purgeTimerTasks()
Invoke purge() on the underlying shared Timer so that internal resources will be released.
|
void |
setFlushCacheOnDeallocate(boolean flushCacheOnDeallocate)
By default, the connection resets statement cache in case deallocate all/discard all
message is observed.
|
addDataType, addDataType, alterUserPassword, createArrayOf, escapeIdentifier, escapeLiteral, getAdaptiveFetch, getAutosave, getBackendPID, getCopyAPI, getDefaultFetchSize, getFastpathAPI, getLargeObjectAPI, getNotifications, getNotifications, getParameterStatus, getParameterStatuses, getPreferQueryMode, getPrepareThreshold, getReplicationAPI, setAdaptiveFetch, setAutosave, setDefaultFetchSize, setPrepareThresholdabort, clearWarnings, close, commit, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStatement, createStatement, createStatement, createStruct, getAutoCommit, getCatalog, getClientInfo, getClientInfo, getHoldability, getMetaData, getNetworkTimeout, getSchema, getTransactionIsolation, getTypeMap, getWarnings, isClosed, isReadOnly, isValid, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, rollback, setAutoCommit, setCatalog, setClientInfo, setClientInfo, setHoldability, setNetworkTimeout, setReadOnly, setSavepoint, setSavepoint, setSchema, setTransactionIsolation, setTypeMapvoid cancelQuery()
throws java.sql.SQLException
cancelQuery in interface PGConnectionjava.sql.SQLException - if something goes wrong.java.sql.ResultSet execSQLQuery(java.lang.String s)
throws java.sql.SQLException
s - the query to executejava.sql.SQLException - if something goes wrong.java.sql.ResultSet execSQLQuery(java.lang.String s,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
java.sql.SQLExceptionvoid execSQLUpdate(java.lang.String s)
throws java.sql.SQLException
s - the query to executejava.sql.SQLException - if something goes wrong.QueryExecutor getQueryExecutor()
ReplicationProtocol getReplicationProtocol()
java.lang.Object getObject(java.lang.String type,
java.lang.String value,
byte[] byteValue)
throws java.sql.SQLException
PGConnection.addDataType(String, Class) and
PGConnection.addDataType(String, String).
If no class is registered as handling the given type, then a generic
PGobject instance is returned.
value or byteValue must be non-null
type - the backend typenamevalue - the type-specific string representation of the valuebyteValue - the type-specific binary representation of the valuejava.sql.SQLException - if something goes wrongEncoding getEncoding() throws java.sql.SQLException
java.sql.SQLExceptionTypeInfo getTypeInfo()
boolean haveMinimumServerVersion(int ver)
The input version is of the form xxyyzz, matching a PostgreSQL version like xx.yy.zz. So 9.0.12 is 90012.
ver - the server version to check, of the form xxyyzz eg 90401boolean haveMinimumServerVersion(Version ver)
The input version is of the form xxyyzz, matching a PostgreSQL version like xx.yy.zz. So 9.0.12 is 90012.
ver - the server version to checkbyte[] encodeString(java.lang.String str)
throws java.sql.SQLException
str - the string to encodejava.sql.SQLException - if something goes wrong.java.lang.String escapeString(java.lang.String str)
throws java.sql.SQLException
getStandardConformingStrings().str - a string valuejava.sql.SQLException - if the string contains a \0 characterboolean getStandardConformingStrings()
standard_conforming_strings server variable.QueryExecutor.getStandardConformingStrings()@Deprecated TimestampUtils getTimestampUtils()
java.util.logging.Logger getLogger()
boolean getStringVarcharFlag()
TransactionState getTransactionState()
boolean binaryTransferSend(int oid)
oid - The oid to check.boolean isColumnSanitiserDisabled()
void addTimerTask(java.util.TimerTask timerTask,
long milliSeconds)
timerTask - timer task to schedulemilliSeconds - delay in millisecondsvoid purgeTimerTasks()
LruCache<FieldMetadata.Key,FieldMetadata> getFieldMetadataCache()
CachedQuery createQuery(java.lang.String sql, boolean escapeProcessing, boolean isParameterized, java.lang.String... columnNames) throws java.sql.SQLException
java.sql.SQLExceptionvoid setFlushCacheOnDeallocate(boolean flushCacheOnDeallocate)
flushCacheOnDeallocate - true if statement cache should be reset when "deallocate/discard" message observedboolean hintReadOnly()
PGProperty.READ_ONLY_MODEPGXmlFactoryFactory getXmlFactoryFactory() throws java.sql.SQLException
java.sql.SQLException - if the class cannot be found or instantiated.boolean getLogServerErrorDetail()
Copyright © 2025 PostgreSQL Global Development Group. All rights reserved.