public interface BaseConnection extends PGConnection, Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE| Modifier and Type | Method and Description |
|---|---|
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 |
cancelQuery()
Cancel the current query executing on this connection.
|
byte[] |
encodeString(String str)
Encode a string using the database's client_encoding (usually UTF8, but can vary on older
server versions).
|
String |
escapeString(String str)
Escapes a string for use as string-literal within an SQL command.
|
ResultSet |
execSQLQuery(String s)
Execute a SQL query that returns a single resultset.
|
ResultSet |
execSQLQuery(String s,
int resultSetType,
int resultSetConcurrency) |
void |
execSQLUpdate(String s)
Execute a SQL query that does not return results.
|
Encoding |
getEncoding() |
Logger |
getLogger() |
Object |
getObject(String type,
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.
|
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() |
int |
getTransactionState()
Get the current transaction state of this connection.
|
TypeInfo |
getTypeInfo() |
boolean |
haveMinimumCompatibleVersion(int ver)
Check if we should use driver behaviour introduced in a particular driver version.
|
boolean |
haveMinimumCompatibleVersion(String ver)
Deprecated.
Avoid using this in new code that can require PgJDBC 9.4.
|
boolean |
haveMinimumCompatibleVersion(Version ver)
Check if we should use driver behaviour introduced in a particular driver version.
|
boolean |
haveMinimumServerVersion(int ver)
Check if we have at least a particular server version.
|
boolean |
haveMinimumServerVersion(String ver)
Deprecated.
Use haveMinimumServerVersion(int) instead
|
boolean |
haveMinimumServerVersion(Version ver)
Check if we have at least a particular server version.
|
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.
|
addDataType, addDataType, escapeIdentifier, escapeLiteral, getBackendPID, getCopyAPI, getDefaultFetchSize, getFastpathAPI, getLargeObjectAPI, getNotifications, getPrepareThreshold, 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, setTypeMapisWrapperFor, unwrapvoid cancelQuery()
throws SQLException
SQLException - if something goes wrong.ResultSet execSQLQuery(String s) throws SQLException
s - the query to executeSQLException - if something goes wrong.ResultSet execSQLQuery(String s, int resultSetType, int resultSetConcurrency) throws SQLException
SQLExceptionvoid execSQLUpdate(String s) throws SQLException
s - the query to executeSQLException - if something goes wrong.QueryExecutor getQueryExecutor()
Object getObject(String type, String value, byte[] byteValue) throws 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.
type - the backend typenamevalue - the type-specific string representation of the valuebyteValue - the type-specific binary representation of the valueSQLException - if something goes wrongEncoding getEncoding() throws SQLException
SQLExceptionTypeInfo getTypeInfo()
@Deprecated boolean haveMinimumCompatibleVersion(String ver)
ver - the driver version to checkboolean haveMinimumCompatibleVersion(int ver)
ver - the driver version to check, eg 90401 for 9.4.1boolean haveMinimumCompatibleVersion(Version ver)
ver - the driver version to check@Deprecated boolean haveMinimumServerVersion(String ver)
ver - the server version to checkboolean haveMinimumServerVersion(int ver)
ver - the server version to check, of the form xxyyzz eg 90401boolean haveMinimumServerVersion(Version ver)
ver - the server version to checkbyte[] encodeString(String str) throws SQLException
str - the string to encodeSQLException - if something goes wrong.String escapeString(String str) throws SQLException
getStandardConformingStrings().str - a string valueSQLException - if the string contains a \0 characterboolean getStandardConformingStrings()
ProtocolConnection.getStandardConformingStrings()TimestampUtils getTimestampUtils()
Logger getLogger()
boolean getStringVarcharFlag()
int getTransactionState()
boolean binaryTransferSend(int oid)
oid - The oid to check.boolean isColumnSanitiserDisabled()
void addTimerTask(TimerTask timerTask, long milliSeconds)
timerTask - timer task to schedulemilliSeconds - delay in millisecondsvoid purgeTimerTasks()
Copyright © 2016 PostgreSQL Global Development Group. All rights reserved.