パッケージ org.postgresql.core
インタフェース BaseConnection
- すべてのスーパーインタフェース:
AutoCloseable
,Connection
,PGConnection
,Wrapper
- 既知の実装クラスのリスト:
PgConnection
Driver-internal connection interface. Application code should not use this interface.
-
フィールドの概要
インタフェースから継承されたフィールド java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
-
メソッドの概要
修飾子とタイプメソッド説明void
addTimerTask
(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
Cancel the current query executing on this connection.createQuery
(String sql, boolean escapeProcessing, boolean isParameterized, String... columnNames) byte @PolyNull []
encodeString
(@PolyNull String str) Encode a string using the database's client_encoding (usually UTF8, but can vary on older server versions).escapeString
(String str) Escapes a string for use as string-literal within an SQL command.Execute a SQL query that returns a single resultset.execSQLQuery
(String s, int resultSetType, int resultSetConcurrency) void
Execute a SQL query that does not return results.Return metadata cache for given connection.boolean
Indicates if error details from server used in included in logging and exceptions.Construct and return an appropriate object for the given type and value.Get the QueryExecutor implementation for this connection.Internal protocol for work with physical and logical replication.boolean
Returns whether the server treats string-literals according to the SQL standard or if it uses traditional PostgreSQL escaping rules.boolean
推奨されていません。Get the current transaction state of this connection.Retrieve the factory to instantiate XML processing factories.boolean
haveMinimumServerVersion
(int ver) Check if we have at least a particular server version.boolean
Check if we have at least a particular server version.boolean
Indicates if statements to backend should be hinted as read only.boolean
Return whether to disable column name sanitation.void
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.インタフェースから継承されたメソッド java.sql.Connection
abort, beginRequest, clearWarnings, close, commit, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStatement, createStatement, createStatement, createStruct, endRequest, 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, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid, setTransactionIsolation, setTypeMap
インタフェースから継承されたメソッド org.postgresql.PGConnection
addDataType, addDataType, alterUserPassword, createArrayOf, escapeIdentifier, escapeLiteral, getAdaptiveFetch, getAutosave, getBackendPID, getCopyAPI, getDefaultFetchSize, getFastpathAPI, getLargeObjectAPI, getNotifications, getNotifications, getParameterStatus, getParameterStatuses, getPreferQueryMode, getPrepareThreshold, getReplicationAPI, setAdaptiveFetch, setAutosave, setDefaultFetchSize, setPrepareThreshold
インタフェースから継承されたメソッド java.sql.Wrapper
isWrapperFor, unwrap
-
メソッドの詳細
-
cancelQuery
Cancel the current query executing on this connection.- 定義:
cancelQuery
インタフェース内PGConnection
- 例外:
SQLException
- if something goes wrong.
-
execSQLQuery
Execute a SQL query that returns a single resultset. Never causes a new transaction to be started regardless of the autocommit setting.- パラメータ:
s
- the query to execute- 戻り値:
- the (non-null) returned resultset
- 例外:
SQLException
- if something goes wrong.
-
execSQLQuery
- 例外:
SQLException
-
execSQLUpdate
Execute a SQL query that does not return results. Never causes a new transaction to be started regardless of the autocommit setting.- パラメータ:
s
- the query to execute- 例外:
SQLException
- if something goes wrong.
-
getQueryExecutor
QueryExecutor getQueryExecutor()Get the QueryExecutor implementation for this connection.- 戻り値:
- the (non-null) executor
-
getReplicationProtocol
ReplicationProtocol getReplicationProtocol()Internal protocol for work with physical and logical replication. Physical replication available only since PostgreSQL version 9.1. Logical replication available only since PostgreSQL version 9.4.- 戻り値:
- not null replication protocol
-
getObject
Object getObject(String type, @Nullable String value, byte @Nullable [] byteValue) throws SQLException Construct and return an appropriate object for the given type and value. This only considers the types registered via
PGConnection.addDataType(String, Class)
andPGConnection.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 value- 戻り値:
- an appropriate object; never null.
- 例外:
SQLException
- if something goes wrong
-
getEncoding
- 例外:
SQLException
-
getTypeInfo
TypeInfo getTypeInfo() -
haveMinimumServerVersion
boolean haveMinimumServerVersion(int ver) Check if we have at least a particular server version.
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 90401- 戻り値:
- true if the server version is at least "ver".
-
haveMinimumServerVersion
Check if we have at least a particular server version.
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- 戻り値:
- true if the server version is at least "ver".
-
encodeString
Encode a string using the database's client_encoding (usually UTF8, but can vary on older server versions). This is used when constructing synthetic resultsets (for example, in metadata methods).- パラメータ:
str
- the string to encode- 戻り値:
- an encoded representation of the string
- 例外:
SQLException
- if something goes wrong.
-
escapeString
Escapes a string for use as string-literal within an SQL command. The method chooses the applicable escaping rules based on the value ofgetStandardConformingStrings()
.- パラメータ:
str
- a string value- 戻り値:
- the escaped representation of the string
- 例外:
SQLException
- if the string contains a\0
character
-
getStandardConformingStrings
boolean getStandardConformingStrings()Returns whether the server treats string-literals according to the SQL standard or if it uses traditional PostgreSQL escaping rules. Versions up to 8.1 always treated backslashes as escape characters in string-literals. Since 8.2, this depends on the value of thestandard_conforming_strings
server variable.- 戻り値:
- true if the server treats string literals according to the SQL standard
- 関連項目:
-
getTimestampUtils
推奨されていません。 -
getLogger
Logger getLogger() -
getStringVarcharFlag
boolean getStringVarcharFlag() -
getTransactionState
TransactionState getTransactionState()Get the current transaction state of this connection.- 戻り値:
- current transaction state of this connection
-
binaryTransferSend
boolean binaryTransferSend(int oid) Returns true if value for the given oid should be sent using binary transfer. False if value should be sent using text transfer.- パラメータ:
oid
- The oid to check.- 戻り値:
- True for binary transfer, false for text transfer.
-
isColumnSanitiserDisabled
boolean isColumnSanitiserDisabled()Return whether to disable column name sanitation.- 戻り値:
- true column sanitizer is disabled
-
addTimerTask
Schedule a TimerTask for later execution. The task will be scheduled with the shared Timer for this connection.- パラメータ:
timerTask
- timer task to schedulemilliSeconds
- delay in milliseconds
-
purgeTimerTasks
void purgeTimerTasks()Invoke purge() on the underlying shared Timer so that internal resources will be released. -
getFieldMetadataCache
LruCache<FieldMetadata.Key,FieldMetadata> getFieldMetadataCache()Return metadata cache for given connection.- 戻り値:
- metadata cache
-
createQuery
CachedQuery createQuery(String sql, boolean escapeProcessing, boolean isParameterized, String... columnNames) throws SQLException - 例外:
SQLException
-
setFlushCacheOnDeallocate
void setFlushCacheOnDeallocate(boolean flushCacheOnDeallocate) By default, the connection resets statement cache in case deallocate all/discard all message is observed. This API allows to disable that feature for testing purposes.- パラメータ:
flushCacheOnDeallocate
- true if statement cache should be reset when "deallocate/discard" message observed
-
hintReadOnly
boolean hintReadOnly()Indicates if statements to backend should be hinted as read only.- 戻り値:
- Indication if hints to backend (such as when transaction begins) should be read only.
- 関連項目:
-
getXmlFactoryFactory
Retrieve the factory to instantiate XML processing factories.- 戻り値:
- The factory to use to instantiate XML processing factories
- 例外:
SQLException
- if the class cannot be found or instantiated.
-
getLogServerErrorDetail
boolean getLogServerErrorDetail()Indicates if error details from server used in included in logging and exceptions.- 戻り値:
- true if should be included and passed on to other exceptions
-