Package com.impossibl.postgres.api.jdbc
Interface PGConnection
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.sql.Connection
,java.sql.Wrapper
- All Known Implementing Classes:
PGDirectConnection
,PGPooledConnectionDelegator
,PGXAConnectionDelegator
public interface PGConnection extends java.sql.Connection
Public API for PGConnection
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addNotificationListener(PGNotificationListener listener)
Adds an, unnamed, unfiltered, asynchronous notification listener to this connectionvoid
addNotificationListener(java.lang.String channelNameFilter, PGNotificationListener listener)
Adds an, unnamed, filtered, asynchronous notification listener to this connectionvoid
addNotificationListener(java.lang.String name, java.lang.String channelNameFilter, PGNotificationListener listener)
Adds a filtered asynchronous notification listener to this connectionjava.lang.Integer
getDefaultFetchSize()
Get the default fetch sizeboolean
isServerMinimumVersion(int major, int minor)
Checks the minimum server versionboolean
isStrictMode()
Is strict modevoid
removeNotificationListener(PGNotificationListener listener)
Removes a notification listenervoid
removeNotificationListener(java.lang.String name)
Removes a named notification listenerPGAnyType
resolveType(java.lang.String name)
Resolves a name to an SQLType suitable for passing to any method that accepts one.void
setDefaultFetchSize(java.lang.Integer v)
Set the default fetch sizevoid
setStrictMode(boolean v)
Set strict mode-
Methods inherited from interface 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
-
-
-
-
Method Detail
-
isServerMinimumVersion
boolean isServerMinimumVersion(int major, int minor)
Checks the minimum server version- Parameters:
major
- The major releaseminor
- The minor release- Returns:
True
if the server is minimum the specified version, otherwisefalse
.
-
addNotificationListener
void addNotificationListener(java.lang.String name, java.lang.String channelNameFilter, PGNotificationListener listener)
Adds a filtered asynchronous notification listener to this connection- Parameters:
name
- Name of listenerchannelNameFilter
- Channel name based notification filter (Regular Expression)listener
- Notification listener
-
addNotificationListener
void addNotificationListener(java.lang.String channelNameFilter, PGNotificationListener listener)
Adds an, unnamed, filtered, asynchronous notification listener to this connection- Parameters:
channelNameFilter
- Channel name based notification filter (Regular Expression)listener
- Notification listener
-
addNotificationListener
void addNotificationListener(PGNotificationListener listener)
Adds an, unnamed, unfiltered, asynchronous notification listener to this connection- Parameters:
listener
- Notification listener
-
removeNotificationListener
void removeNotificationListener(java.lang.String name)
Removes a named notification listener- Parameters:
name
- Name of listener to remove
-
removeNotificationListener
void removeNotificationListener(PGNotificationListener listener)
Removes a notification listener- Parameters:
listener
- Listener instance to remove
-
setStrictMode
void setStrictMode(boolean v)
Set strict mode- Parameters:
v
- The value
-
isStrictMode
boolean isStrictMode()
Is strict mode- Returns:
- The value
-
setDefaultFetchSize
void setDefaultFetchSize(java.lang.Integer v)
Set the default fetch size- Parameters:
v
- The value
-
getDefaultFetchSize
java.lang.Integer getDefaultFetchSize()
Get the default fetch size- Returns:
- The value
-
resolveType
PGAnyType resolveType(java.lang.String name) throws java.sql.SQLException
Resolves a name to an SQLType suitable for passing to any method that accepts one. As the method queries the server for the type information any type name acceptable to the server is allowed (i.e. qualified, unqualified, quoted, etc.) Using this method allows the resolution of a name to a type to be re-used; speeding up performance in cases where named types are used. NOTE: The possibility of DDL changing the name to type mapping means named types are always looked up when used. This ensures that the correct type is used always. When resolving a named type using this method it is only valid as long as no commands are issued that invalidate it (e.g. dropping and re-adding a type or extension).- Parameters:
name
- Name of type to resolve (anything acceptable to the server)- Returns:
- Type instance representing the current name to type mapping.
- Throws:
java.sql.SQLException
-
-