Package org.postgresql.ds.common
Class BaseDataSource
java.lang.Object
org.postgresql.ds.common.BaseDataSource
- All Implemented Interfaces:
Referenceable
,CommonDataSource
- Direct Known Subclasses:
PGConnectionPoolDataSource
,PGPoolingDataSource
,PGSimpleDataSource
,PGXADataSource
Base class for data sources and related classes.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Reference
Generates a reference using the appropriate object factory.boolean
int
int
boolean
@Nullable String
@Nullable String
boolean
int
boolean
see PGProperty#CLEANUP_SAVEPOINTSGets a connection to the PostgreSQL database.getConnection
(@Nullable String user, @Nullable String password) Gets a connection to the PostgreSQL database.int
@Nullable String
int
int
@Nullable String
Gets the name of the PostgreSQL database, running on the server identified by the serverName property.int
abstract String
Gets a description of this DataSource-ish thing.boolean
boolean
This is important in pool-by-transaction scenarios in order to make sure that all the statements reaches the same connection that is being initialized.@Nullable String
int
boolean
int
@Nullable String
boolean
@Nullable String
boolean
@Nullable String
@Nullable String
Deprecated.Configure via java.util.logging@Nullable String
Deprecated.Configure via java.util.loggingint
boolean
boolean
@Nullable PrintWriter
This implementation don't use a LogWriter.@Nullable String
@Nullable String
@Nullable String
Gets the password to connect with by default.int
Deprecated.usegetPortNumbers()
int[]
Gets the port(s) which the PostgreSQL server is listening on for TCP/IP connections.int
int
int
@Nullable String
getProperty
(String name) @Nullable String
getProperty
(PGProperty property) int
boolean
boolean
int
int
@Nullable String
boolean
int
Deprecated.usegetServerNames()
String[]
Gets the name of the host(s) the PostgreSQL database is running on.@Nullable String
@Nullable String
int
boolean
getSsl()
@Nullable String
@Nullable String
@Nullable String
@Nullable String
@Nullable String
@Nullable String
@Nullable String
@Nullable String
@Nullable String
@Nullable String
@Nullable String
@Nullable String
@Nullable String
@Nullable String
@Nullable String
int
@Nullable String
@Nullable String
@Nullable String
@Nullable String
boolean
boolean
int
getUrl()
Generates aDriverManager
URL from the other properties supplied.getURL()
Generates aDriverManager
URL from the other properties supplied.@Nullable String
getUser()
Gets the user to connect as by default.boolean
void
initializeFrom
(BaseDataSource source) boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
isSsl()
boolean
protected void
void
setAdaptiveFetch
(boolean adaptiveFetch) void
setAdaptiveFetchMaximum
(int adaptiveFetchMaximum) void
setAdaptiveFetchMinimum
(int adaptiveFetchMinimum) void
setAllowEncodingChanges
(boolean allow) void
setApplicationName
(@Nullable String applicationName) void
setAssumeMinServerVersion
(@Nullable String minVersion) void
setAuthenticationPluginClassName
(String className) void
setAutosave
(AutoSave autoSave) void
setBinaryTransfer
(boolean enabled) void
setBinaryTransferDisable
(@Nullable String oidList) void
setBinaryTransferEnable
(@Nullable String oidList) void
setCancelSignalTimeout
(int seconds) void
setCleanupSavepoints
(boolean cleanupSavepoints) see PGProperty#CLEANUP_SAVEPOINTSvoid
setCleanupSavePoints
(boolean cleanupSavepoints) void
setConnectTimeout
(int connectTimeout) void
setCurrentSchema
(@Nullable String currentSchema) void
setDatabaseMetadataCacheFields
(int cacheSize) void
setDatabaseMetadataCacheFieldsMiB
(int cacheSize) void
setDatabaseName
(@Nullable String databaseName) Sets the name of the PostgreSQL database, running on the server identified by the serverName property.void
setDefaultRowFetchSize
(int fetchSize) void
setDisableColumnSanitiser
(boolean disableColumnSanitiser) void
setEscapeSyntaxCallMode
(@Nullable String callMode) void
void
setGroupStartupParameters
(boolean groupStartupParameters) void
setGssEncMode
(@Nullable String mode) void
void
setGssResponseTimeout
(int gssResponseTimeout) void
setHideUnprivilegedObjects
(boolean hideUnprivileged) void
setHostRecheckSeconds
(int hostRecheckSeconds) void
setJaasApplicationName
(@Nullable String name) void
setJaasLogin
(boolean doLogin) void
setKerberosServerName
(@Nullable String serverName) void
setLoadBalanceHosts
(boolean loadBalanceHosts) void
setLocalSocketAddress
(String localSocketAddress) void
setLoggerFile
(@Nullable String loggerFile) Deprecated.Configure via java.util.loggingvoid
setLoggerLevel
(@Nullable String loggerLevel) Deprecated.Configure via java.util.loggingvoid
setLoginTimeout
(int loginTimeout) void
setLogServerErrorDetail
(boolean enabled) void
setLogUnclosedConnections
(boolean enabled) void
setLogWriter
(@Nullable PrintWriter printWriter) This implementation don't use a LogWriter.void
setMaxResultBuffer
(@Nullable String maxResultBuffer) void
setOptions
(@Nullable String options) Set command line options for this connectionvoid
setPassword
(@Nullable String password) Sets the password to connect with by default.void
setPortNumber
(int portNumber) Deprecated.void
setPortNumbers
(int @Nullable [] portNumbers) Sets the port(s) which the PostgreSQL server is listening on for TCP/IP connections.void
setPreferQueryMode
(PreferQueryMode preferQueryMode) void
setPreparedStatementCacheQueries
(int cacheSize) void
setPreparedStatementCacheSizeMiB
(int cacheSize) void
setPrepareThreshold
(int count) void
setProperty
(String name, @Nullable String value) void
setProperty
(PGProperty property, @Nullable String value) void
setProtocolVersion
(int protocolVersion) void
setQuoteReturningIdentifiers
(boolean quoteIdentifiers) void
setReadOnly
(boolean readOnly) void
setReadOnlyMode
(@Nullable String mode) void
setReceiveBufferSize
(int nbytes) void
setRecvBufferSize
(int nbytes) void
setReplication
(@Nullable String replication) void
setReWriteBatchedInserts
(boolean reWrite) void
setSendBufferSize
(int nbytes) void
setServerName
(String serverName) Deprecated.void
setServerNames
(@Nullable String @Nullable [] serverNames) Sets the name of the host(s) the PostgreSQL database is running on.void
setSocketFactory
(@Nullable String socketFactoryClassName) void
setSocketFactoryArg
(@Nullable String socketFactoryArg) void
setSocketTimeout
(int seconds) void
setSsl
(boolean enabled) void
setSslcert
(@Nullable String file) void
setSslCert
(@Nullable String file) void
setSslfactory
(String classname) void
setSslfactoryarg
(@Nullable String arg) void
setSslFactoryArg
(@Nullable String arg) void
setSslhostnameverifier
(@Nullable String className) void
setSslHostnameVerifier
(@Nullable String className) void
void
void
setSslmode
(@Nullable String mode) void
setSslMode
(@Nullable String mode) void
setSslpassword
(String sslpassword) void
setSslPassword
(@Nullable String password) void
setSslpasswordcallback
(@Nullable String className) void
setSslPasswordCallback
(@Nullable String className) void
setSslResponseTimeout
(int sslResponseTimeout) void
setSslrootcert
(@Nullable String file) void
setSslRootCert
(@Nullable String file) void
setSspiServiceClass
(@Nullable String serviceClass) void
setStringType
(@Nullable String stringType) void
setTargetServerType
(@Nullable String targetServerType) void
setTcpKeepAlive
(boolean enabled) void
setTcpNoDelay
(boolean enabled) void
setUnknownLength
(int unknownLength) void
Sets properties from aDriverManager
URL.void
Sets properties from aDriverManager
URL.void
Sets the user to connect as by default.void
setUseSpNego
(boolean use) void
setXmlFactoryFactory
(@Nullable String xmlFactoryFactory) protected void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilder
-
Constructor Details
-
BaseDataSource
public BaseDataSource()
-
-
Method Details
-
getConnection
Gets a connection to the PostgreSQL database. The database is identified by the DataSource properties serverName, databaseName, and portNumber. The user to connect as is identified by the DataSource properties user and password.- Returns:
- A valid database connection.
- Throws:
SQLException
- Occurs when the database connection cannot be established.
-
getConnection
public Connection getConnection(@Nullable String user, @Nullable String password) throws SQLException Gets a connection to the PostgreSQL database. The database is identified by the DataSource properties serverName, databaseName, and portNumber. The user to connect as is identified by the arguments user and password, which override the DataSource properties by the same name.- Parameters:
user
- userpassword
- password- Returns:
- A valid database connection.
- Throws:
SQLException
- Occurs when the database connection cannot be established.
-
getLogWriter
This implementation don't use a LogWriter.- Specified by:
getLogWriter
in interfaceCommonDataSource
-
setLogWriter
This implementation don't use a LogWriter.- Specified by:
setLogWriter
in interfaceCommonDataSource
- Parameters:
printWriter
- Not used
-
getServerName
Deprecated.usegetServerNames()
Gets the name of the host the PostgreSQL database is running on.- Returns:
- name of the host the PostgreSQL database is running on
-
getServerNames
Gets the name of the host(s) the PostgreSQL database is running on.- Returns:
- name of the host(s) the PostgreSQL database is running on
-
setServerName
Deprecated.Sets the name of the host the PostgreSQL database is running on. If this is changed, it will only affect future calls to getConnection. The default value islocalhost
.- Parameters:
serverName
- name of the host the PostgreSQL database is running on
-
setServerNames
Sets the name of the host(s) the PostgreSQL database is running on. If this is changed, it will only affect future calls to getConnection. The default value islocalhost
.- Parameters:
serverNames
- name of the host(s) the PostgreSQL database is running on
-
getDatabaseName
Gets the name of the PostgreSQL database, running on the server identified by the serverName property.- Returns:
- name of the PostgreSQL database
-
setDatabaseName
Sets the name of the PostgreSQL database, running on the server identified by the serverName property. If this is changed, it will only affect future calls to getConnection.- Parameters:
databaseName
- name of the PostgreSQL database
-
getDescription
Gets a description of this DataSource-ish thing. Must be customized by subclasses.- Returns:
- description of this DataSource-ish thing
-
getUser
Gets the user to connect as by default. If this is not specified, you must use the getConnection method which takes a user and password as parameters.- Returns:
- user to connect as by default
-
setUser
Sets the user to connect as by default. If this is not specified, you must use the getConnection method which takes a user and password as parameters. If this is changed, it will only affect future calls to getConnection.- Parameters:
user
- user to connect as by default
-
getPassword
Gets the password to connect with by default. If this is not specified but a password is needed to log in, you must use the getConnection method which takes a user and password as parameters.- Returns:
- password to connect with by default
-
setPassword
Sets the password to connect with by default. If this is not specified but a password is needed to log in, you must use the getConnection method which takes a user and password as parameters. If this is changed, it will only affect future calls to getConnection.- Parameters:
password
- password to connect with by default
-
getPortNumber
Deprecated.usegetPortNumbers()
Gets the port which the PostgreSQL server is listening on for TCP/IP connections.- Returns:
- The port, or 0 if the default port will be used.
-
getPortNumbers
public int[] getPortNumbers()Gets the port(s) which the PostgreSQL server is listening on for TCP/IP connections.- Returns:
- The port(s), or 0 if the default port will be used.
-
setPortNumber
Deprecated.Sets the port which the PostgreSQL server is listening on for TCP/IP connections. Be sure the -i flag is passed to postmaster when PostgreSQL is started. If this is not set, or set to 0, the default port will be used.- Parameters:
portNumber
- port which the PostgreSQL server is listening on for TCP/IP
-
setPortNumbers
public void setPortNumbers(int @Nullable [] portNumbers) Sets the port(s) which the PostgreSQL server is listening on for TCP/IP connections. Be sure the -i flag is passed to postmaster when PostgreSQL is started. If this is not set, or set to 0, the default port will be used.- Parameters:
portNumbers
- port(s) which the PostgreSQL server is listening on for TCP/IP
-
getOptions
- Returns:
- command line options for this connection
-
setOptions
Set command line options for this connection- Parameters:
options
- string to set options to
-
getLoginTimeout
public int getLoginTimeout()- Specified by:
getLoginTimeout
in interfaceCommonDataSource
- Returns:
- login timeout
- See Also:
-
setLoginTimeout
public void setLoginTimeout(int loginTimeout) - Specified by:
setLoginTimeout
in interfaceCommonDataSource
- Parameters:
loginTimeout
- login timeout- See Also:
-
getConnectTimeout
public int getConnectTimeout()- Returns:
- connect timeout
- See Also:
-
setConnectTimeout
public void setConnectTimeout(int connectTimeout) - Parameters:
connectTimeout
- connect timeout- See Also:
-
getGssResponseTimeout
public int getGssResponseTimeout()- Returns:
- GSS ResponseTimeout
- See Also:
-
setGssResponseTimeout
public void setGssResponseTimeout(int gssResponseTimeout) - Parameters:
gssResponseTimeout
- gss response timeout- See Also:
-
getSslResponseTimeout
public int getSslResponseTimeout()- Returns:
- SSL ResponseTimeout
- See Also:
-
setSslResponseTimeout
public void setSslResponseTimeout(int sslResponseTimeout) - Parameters:
sslResponseTimeout
- ssl response timeout- See Also:
-
getProtocolVersion
public int getProtocolVersion()- Returns:
- protocol version
- See Also:
-
setProtocolVersion
public void setProtocolVersion(int protocolVersion) - Parameters:
protocolVersion
- protocol version- See Also:
-
getQuoteReturningIdentifiers
public boolean getQuoteReturningIdentifiers()- Returns:
- quoteReturningIdentifiers
- See Also:
-
setQuoteReturningIdentifiers
public void setQuoteReturningIdentifiers(boolean quoteIdentifiers) - Parameters:
quoteIdentifiers
- indicate whether to quote identifiers- See Also:
-
getReceiveBufferSize
public int getReceiveBufferSize()- Returns:
- receive buffer size
- See Also:
-
setReceiveBufferSize
public void setReceiveBufferSize(int nbytes) - Parameters:
nbytes
- receive buffer size- See Also:
-
getSendBufferSize
public int getSendBufferSize()- Returns:
- send buffer size
- See Also:
-
setSendBufferSize
public void setSendBufferSize(int nbytes) - Parameters:
nbytes
- send buffer size- See Also:
-
setPrepareThreshold
public void setPrepareThreshold(int count) - Parameters:
count
- prepare threshold- See Also:
-
getPrepareThreshold
public int getPrepareThreshold()- Returns:
- prepare threshold
- See Also:
-
getPreparedStatementCacheQueries
public int getPreparedStatementCacheQueries()- Returns:
- prepared statement cache size (number of statements per connection)
- See Also:
-
setPreparedStatementCacheQueries
public void setPreparedStatementCacheQueries(int cacheSize) - Parameters:
cacheSize
- prepared statement cache size (number of statements per connection)- See Also:
-
getPreparedStatementCacheSizeMiB
public int getPreparedStatementCacheSizeMiB()- Returns:
- prepared statement cache size (number of megabytes per connection)
- See Also:
-
setPreparedStatementCacheSizeMiB
public void setPreparedStatementCacheSizeMiB(int cacheSize) - Parameters:
cacheSize
- statement cache size (number of megabytes per connection)- See Also:
-
getDatabaseMetadataCacheFields
public int getDatabaseMetadataCacheFields()- Returns:
- database metadata cache fields size (number of fields cached per connection)
- See Also:
-
setDatabaseMetadataCacheFields
public void setDatabaseMetadataCacheFields(int cacheSize) - Parameters:
cacheSize
- database metadata cache fields size (number of fields cached per connection)- See Also:
-
getDatabaseMetadataCacheFieldsMiB
public int getDatabaseMetadataCacheFieldsMiB()- Returns:
- database metadata cache fields size (number of megabytes per connection)
- See Also:
-
setDatabaseMetadataCacheFieldsMiB
public void setDatabaseMetadataCacheFieldsMiB(int cacheSize) - Parameters:
cacheSize
- database metadata cache fields size (number of megabytes per connection)- See Also:
-
setDefaultRowFetchSize
public void setDefaultRowFetchSize(int fetchSize) - Parameters:
fetchSize
- default fetch size- See Also:
-
getDefaultRowFetchSize
public int getDefaultRowFetchSize()- Returns:
- default fetch size
- See Also:
-
setUnknownLength
public void setUnknownLength(int unknownLength) - Parameters:
unknownLength
- unknown length- See Also:
-
getUnknownLength
public int getUnknownLength()- Returns:
- unknown length
- See Also:
-
setSocketTimeout
public void setSocketTimeout(int seconds) - Parameters:
seconds
- socket timeout- See Also:
-
getSocketTimeout
public int getSocketTimeout()- Returns:
- socket timeout
- See Also:
-
setCancelSignalTimeout
public void setCancelSignalTimeout(int seconds) - Parameters:
seconds
- timeout that is used for sending cancel command- See Also:
-
getCancelSignalTimeout
public int getCancelSignalTimeout()- Returns:
- timeout that is used for sending cancel command in seconds
- See Also:
-
setSsl
public void setSsl(boolean enabled) - Parameters:
enabled
- if SSL is enabled- See Also:
-
getSsl
public boolean getSsl()- Returns:
- true if SSL is enabled
- See Also:
-
setSslfactory
- Parameters:
classname
- SSL factory class name- See Also:
-
getSslfactory
- Returns:
- SSL factory class name
- See Also:
-
getSslMode
- Returns:
- SSL mode
- See Also:
-
setSslMode
- Parameters:
mode
- SSL mode- See Also:
-
getSslFactoryArg
- Returns:
- SSL mode
- See Also:
-
setSslFactoryArg
- Parameters:
arg
- argument forwarded to SSL factory- See Also:
-
getSslHostnameVerifier
- Returns:
- argument forwarded to SSL factory
- See Also:
-
setSslHostnameVerifier
- Parameters:
className
- SSL hostname verifier- See Also:
-
getSslCert
- Returns:
- className SSL hostname verifier
- See Also:
-
setSslCert
- Parameters:
file
- SSL certificate- See Also:
-
getSslKey
- Returns:
- SSL certificate
- See Also:
-
setSslKey
- Parameters:
file
- SSL key- See Also:
-
getSslRootCert
- Returns:
- SSL root certificate
- See Also:
-
setSslRootCert
- Parameters:
file
- SSL root certificate- See Also:
-
getSslPassword
- Returns:
- SSL password
- See Also:
-
setSslPassword
- Parameters:
password
- SSL password- See Also:
-
getSslPasswordCallback
- Returns:
- SSL password callback
- See Also:
-
setSslPasswordCallback
- Parameters:
className
- SSL password callback class name- See Also:
-
setApplicationName
- Parameters:
applicationName
- application name- See Also:
-
getApplicationName
- Returns:
- application name
- See Also:
-
setTargetServerType
- Parameters:
targetServerType
- target server type- See Also:
-
getTargetServerType
- Returns:
- target server type
- See Also:
-
setLoadBalanceHosts
public void setLoadBalanceHosts(boolean loadBalanceHosts) - Parameters:
loadBalanceHosts
- load balance hosts- See Also:
-
getLoadBalanceHosts
public boolean getLoadBalanceHosts()- Returns:
- load balance hosts
- See Also:
-
setHostRecheckSeconds
public void setHostRecheckSeconds(int hostRecheckSeconds) - Parameters:
hostRecheckSeconds
- host recheck seconds- See Also:
-
getHostRecheckSeconds
public int getHostRecheckSeconds()- Returns:
- host recheck seconds
- See Also:
-
setTcpKeepAlive
public void setTcpKeepAlive(boolean enabled) - Parameters:
enabled
- if TCP keep alive should be enabled- See Also:
-
getTcpKeepAlive
public boolean getTcpKeepAlive()- Returns:
- true if TCP keep alive is enabled
- See Also:
-
setTcpNoDelay
public void setTcpNoDelay(boolean enabled) - Parameters:
enabled
- if TCP no delay should be enabled- See Also:
-
getTcpNoDelay
public boolean getTcpNoDelay()- Returns:
- true if TCP no delay is enabled
- See Also:
-
setBinaryTransfer
public void setBinaryTransfer(boolean enabled) - Parameters:
enabled
- if binary transfer should be enabled- See Also:
-
getBinaryTransfer
public boolean getBinaryTransfer()- Returns:
- true if binary transfer is enabled
- See Also:
-
setBinaryTransferEnable
- Parameters:
oidList
- list of OIDs that are allowed to use binary transfer- See Also:
-
getBinaryTransferEnable
- Returns:
- list of OIDs that are allowed to use binary transfer
- See Also:
-
setBinaryTransferDisable
- Parameters:
oidList
- list of OIDs that are not allowed to use binary transfer- See Also:
-
getBinaryTransferDisable
- Returns:
- list of OIDs that are not allowed to use binary transfer
- See Also:
-
getStringType
- Returns:
- string type
- See Also:
-
setStringType
- Parameters:
stringType
- string type- See Also:
-
isColumnSanitiserDisabled
public boolean isColumnSanitiserDisabled()- Returns:
- true if column sanitizer is disabled
- See Also:
-
getDisableColumnSanitiser
public boolean getDisableColumnSanitiser()- Returns:
- true if column sanitizer is disabled
- See Also:
-
setDisableColumnSanitiser
public void setDisableColumnSanitiser(boolean disableColumnSanitiser) - Parameters:
disableColumnSanitiser
- if column sanitizer should be disabled- See Also:
-
getCurrentSchema
- Returns:
- current schema
- See Also:
-
setCurrentSchema
- Parameters:
currentSchema
- current schema- See Also:
-
getReadOnly
public boolean getReadOnly()- Returns:
- true if connection is readonly
- See Also:
-
setReadOnly
public void setReadOnly(boolean readOnly) - Parameters:
readOnly
- if connection should be readonly- See Also:
-
getReadOnlyMode
- Returns:
- The behavior when set read only
- See Also:
-
setReadOnlyMode
- Parameters:
mode
- the behavior when set read only- See Also:
-
getLogUnclosedConnections
public boolean getLogUnclosedConnections()- Returns:
- true if driver should log unclosed connections
- See Also:
-
setLogUnclosedConnections
public void setLogUnclosedConnections(boolean enabled) - Parameters:
enabled
- true if driver should log unclosed connections- See Also:
-
getLogServerErrorDetail
public boolean getLogServerErrorDetail()- Returns:
- true if driver should log include detail in server error messages
- See Also:
-
setLogServerErrorDetail
public void setLogServerErrorDetail(boolean enabled) - Parameters:
enabled
- true if driver should include detail in server error messages- See Also:
-
getAssumeMinServerVersion
- Returns:
- assumed minimal server version
- See Also:
-
setAssumeMinServerVersion
- Parameters:
minVersion
- assumed minimal server version- See Also:
-
getGroupStartupParameters
public boolean getGroupStartupParameters()This is important in pool-by-transaction scenarios in order to make sure that all the statements reaches the same connection that is being initialized. If set then we will group the startup parameters in a transaction- Returns:
- whether to group startup parameters or not
- See Also:
-
setGroupStartupParameters
public void setGroupStartupParameters(boolean groupStartupParameters) - Parameters:
groupStartupParameters
- whether to group startup Parameters in a transaction or not- See Also:
-
getJaasApplicationName
- Returns:
- JAAS application name
- See Also:
-
setJaasApplicationName
- Parameters:
name
- JAAS application name- See Also:
-
getJaasLogin
public boolean getJaasLogin()- Returns:
- true if perform JAAS login before GSS authentication
- See Also:
-
setJaasLogin
public void setJaasLogin(boolean doLogin) - Parameters:
doLogin
- true if perform JAAS login before GSS authentication- See Also:
-
getKerberosServerName
- Returns:
- Kerberos server name
- See Also:
-
setKerberosServerName
- Parameters:
serverName
- Kerberos server name- See Also:
-
getUseSpNego
public boolean getUseSpNego()- Returns:
- true if use SPNEGO
- See Also:
-
setUseSpNego
public void setUseSpNego(boolean use) - Parameters:
use
- true if use SPNEGO- See Also:
-
getGssLib
- Returns:
- GSS mode: auto, sspi, or gssapi
- See Also:
-
setGssLib
- Parameters:
lib
- GSS mode: auto, sspi, or gssapi- See Also:
-
getGssEncMode
- Returns:
- GSS encryption mode: disable, prefer or require
-
setGssEncMode
- Parameters:
mode
- encryption mode: disable, prefer or require
-
getSspiServiceClass
- Returns:
- SSPI service class
- See Also:
-
setSspiServiceClass
- Parameters:
serviceClass
- SSPI service class- See Also:
-
getAllowEncodingChanges
public boolean getAllowEncodingChanges()- Returns:
- if connection allows encoding changes
- See Also:
-
setAllowEncodingChanges
public void setAllowEncodingChanges(boolean allow) - Parameters:
allow
- if connection allows encoding changes- See Also:
-
getSocketFactory
- Returns:
- socket factory class name
- See Also:
-
setSocketFactory
- Parameters:
socketFactoryClassName
- socket factory class name- See Also:
-
getSocketFactoryArg
- Returns:
- socket factory argument
- See Also:
-
setSocketFactoryArg
- Parameters:
socketFactoryArg
- socket factory argument- See Also:
-
setReplication
- Parameters:
replication
- set to 'database' for logical replication or 'true' for physical replication- See Also:
-
getEscapeSyntaxCallMode
- Returns:
- 'select', "callIfNoReturn', or 'call'
- See Also:
-
setEscapeSyntaxCallMode
- Parameters:
callMode
- the call mode to use for JDBC escape call syntax- See Also:
-
getReplication
- Returns:
- null, 'database', or 'true
- See Also:
-
getLocalSocketAddress
- Returns:
- the localSocketAddress
- See Also:
-
setLocalSocketAddress
- Parameters:
localSocketAddress
- local address to bind client side to- See Also:
-
getLoggerLevel
Deprecated.Configure via java.util.loggingThis property is no longer used by the driver and will be ignored.- Returns:
- loggerLevel in properties
-
setLoggerLevel
Deprecated.Configure via java.util.loggingThis property is no longer used by the driver and will be ignored.- Parameters:
loggerLevel
- loggerLevel to set, will be ignored
-
getLoggerFile
Deprecated.Configure via java.util.loggingThis property is no longer used by the driver and will be ignored.- Returns:
- loggerFile in properties
-
setLoggerFile
Deprecated.Configure via java.util.loggingThis property is no longer used by the driver and will be ignored.- Parameters:
loggerFile
- will be ignored
-
getUrl
Generates aDriverManager
URL from the other properties supplied.- Returns:
DriverManager
URL from the other properties supplied
-
getURL
Generates aDriverManager
URL from the other properties supplied.- Returns:
DriverManager
URL from the other properties supplied
-
setUrl
Sets properties from aDriverManager
URL.- Parameters:
url
- properties to set
-
setURL
Sets properties from aDriverManager
URL. Added to follow convention used in other DBMS.- Parameters:
url
- properties to set
-
getAuthenticationPluginClassName
- Returns:
- the class name to use for the Authentication Plugin. This can be null in which case the default password authentication plugin will be used
-
setAuthenticationPluginClassName
- Parameters:
className
- name of a class which implementsAuthenticationPlugin
This class will be used to get the encoded bytes to be sent to the server as the password to authenticate the user.
-
getProperty
- Throws:
SQLException
-
setProperty
- Throws:
SQLException
-
getProperty
-
setProperty
-
createReference
Generates a reference using the appropriate object factory.- Returns:
- reference using the appropriate object factory
-
getReference
- Specified by:
getReference
in interfaceReferenceable
- Throws:
NamingException
-
setFromReference
-
writeBaseObject
- Throws:
IOException
-
readBaseObject
- Throws:
IOException
ClassNotFoundException
-
initializeFrom
- Throws:
IOException
ClassNotFoundException
-
getPreferQueryMode
- Returns:
- preferred query execution mode
- See Also:
-
setPreferQueryMode
- Parameters:
preferQueryMode
- extended, simple, extendedForPrepared, or extendedCacheEverything- See Also:
-
getAutosave
- Returns:
- connection configuration regarding automatic per-query savepoints
- See Also:
-
setAutosave
- Parameters:
autoSave
- connection configuration regarding automatic per-query savepoints- See Also:
-
getCleanupSavepoints
public boolean getCleanupSavepoints()see PGProperty#CLEANUP_SAVEPOINTS- Returns:
- boolean indicating property set
-
setCleanupSavepoints
public void setCleanupSavepoints(boolean cleanupSavepoints) see PGProperty#CLEANUP_SAVEPOINTS- Parameters:
cleanupSavepoints
- will cleanup savepoints after a successful transaction
-
getReWriteBatchedInserts
public boolean getReWriteBatchedInserts()- Returns:
- boolean indicating property is enabled or not.
- See Also:
-
setReWriteBatchedInserts
public void setReWriteBatchedInserts(boolean reWrite) - Parameters:
reWrite
- boolean value to set the property in the properties collection- See Also:
-
getHideUnprivilegedObjects
public boolean getHideUnprivilegedObjects()- Returns:
- boolean indicating property is enabled or not.
- See Also:
-
setHideUnprivilegedObjects
public void setHideUnprivilegedObjects(boolean hideUnprivileged) - Parameters:
hideUnprivileged
- boolean value to set the property in the properties collection- See Also:
-
getMaxResultBuffer
-
setMaxResultBuffer
-
getAdaptiveFetch
public boolean getAdaptiveFetch() -
setAdaptiveFetch
public void setAdaptiveFetch(boolean adaptiveFetch) -
getAdaptiveFetchMaximum
public int getAdaptiveFetchMaximum() -
setAdaptiveFetchMaximum
public void setAdaptiveFetchMaximum(int adaptiveFetchMaximum) -
getAdaptiveFetchMinimum
public int getAdaptiveFetchMinimum() -
setAdaptiveFetchMinimum
public void setAdaptiveFetchMinimum(int adaptiveFetchMinimum) -
getParentLogger
- Specified by:
getParentLogger
in interfaceCommonDataSource
-
getXmlFactoryFactory
-
setXmlFactoryFactory
-
isSsl
public boolean isSsl() -
getSslfactoryarg
-
setSslfactoryarg
-
getSslcert
-
setSslcert
-
getSslmode
-
setSslmode
-
getSslhostnameverifier
-
setSslhostnameverifier
-
getSslkey
-
setSslkey
-
getSslrootcert
-
setSslrootcert
-
getSslpasswordcallback
-
setSslpasswordcallback
-
getSslpassword
-
setSslpassword
-
getRecvBufferSize
public int getRecvBufferSize() -
setRecvBufferSize
public void setRecvBufferSize(int nbytes) -
isAllowEncodingChanges
public boolean isAllowEncodingChanges() -
isLogUnclosedConnections
public boolean isLogUnclosedConnections() -
isTcpKeepAlive
public boolean isTcpKeepAlive() -
isReadOnly
public boolean isReadOnly() -
isDisableColumnSanitiser
public boolean isDisableColumnSanitiser() -
isLoadBalanceHosts
public boolean isLoadBalanceHosts() -
isCleanupSavePoints
public boolean isCleanupSavePoints() -
setCleanupSavePoints
public void setCleanupSavePoints(boolean cleanupSavepoints) -
isReWriteBatchedInserts
public boolean isReWriteBatchedInserts()
-