public abstract class BaseDataSource extends Object implements CommonDataSource, Referenceable
| Constructor and Description |
|---|
BaseDataSource() |
public boolean getAllowEncodingChanges()
public void setAllowEncodingChanges(boolean allow)
allow - if connection allows encoding changespublic String getCharacterEncoding()
public void setCharacterEncoding(String encode)
set - character encoding.public Connection getConnection() throws SQLException
SQLException - Occurs when the database connection cannot be established.public Connection getConnection(String user, String password) throws SQLException
user - userpassword - passwordSQLException - Occurs when the database connection cannot be established.public PrintWriter getLogWriter()
getLogWriter in interface CommonDataSourcepublic void setLogWriter(PrintWriter printWriter)
setLogWriter in interface CommonDataSourceprintWriter - Not usedpublic String getServerName()
public void setServerName(String serverName)
serverName - name of the host the PostgreSQL database is running onpublic String getDatabaseName()
public void setDatabaseName(String databaseName)
databaseName - name of the PostgreSQL databasepublic abstract String getDescription()
public String getUser()
public void setUser(String user)
user - user to connect as by defaultpublic String getPassword()
public void setPassword(String password)
password - password to connect with by defaultpublic int getPortNumber()
public void setPortNumber(int portNumber)
portNumber - port which the PostgreSQL server is listening on for TCP/IPpublic int getLoginTimeout()
getLoginTimeout in interface CommonDataSourcePGProperty.LOGIN_TIMEOUTpublic void setLoginTimeout(int loginTimeout)
setLoginTimeout in interface CommonDataSourceloginTimeout - login timeoutPGProperty.LOGIN_TIMEOUTpublic int getConnectTimeout()
PGProperty.CONNECT_TIMEOUTpublic void setConnectTimeout(int connectTimeout)
connectTimeout - connect timeoutPGProperty.CONNECT_TIMEOUTpublic int getProtocolVersion()
PGProperty.PROTOCOL_VERSIONpublic void setProtocolVersion(int protocolVersion)
protocolVersion - protocol versionPGProperty.PROTOCOL_VERSIONpublic int getReceiveBufferSize()
PGProperty.RECEIVE_BUFFER_SIZEpublic void setReceiveBufferSize(int nbytes)
nbytes - receive buffer sizePGProperty.RECEIVE_BUFFER_SIZEpublic int getSendBufferSize()
PGProperty.SEND_BUFFER_SIZEpublic void setSendBufferSize(int nbytes)
nbytes - send buffer sizePGProperty.SEND_BUFFER_SIZEpublic void setPrepareThreshold(int count)
count - prepare thresholdPGProperty.PREPARE_THRESHOLDpublic int getPrepareThreshold()
PGProperty.PREPARE_THRESHOLDpublic int getPreparedStatementCacheQueries()
PGProperty.PREPARED_STATEMENT_CACHE_QUERIESpublic void setPreparedStatementCacheQueries(int cacheSize)
cacheSize - prepared statement cache size (number of statements per connection)PGProperty.PREPARED_STATEMENT_CACHE_QUERIESpublic int getPreparedStatementCacheSizeMiB()
PGProperty.PREPARED_STATEMENT_CACHE_SIZE_MIBpublic void setPreparedStatementCacheSizeMiB(int cacheSize)
cacheSize - statement cache size (number of megabytes per connection)PGProperty.PREPARED_STATEMENT_CACHE_SIZE_MIBpublic int getDatabaseMetadataCacheFields()
PGProperty.DATABASE_METADATA_CACHE_FIELDSpublic void setDatabaseMetadataCacheFields(int cacheSize)
cacheSize - database metadata cache fields size (number of fields cached per connection)PGProperty.DATABASE_METADATA_CACHE_FIELDSpublic int getDatabaseMetadataCacheFieldsMiB()
PGProperty.DATABASE_METADATA_CACHE_FIELDS_MIBpublic void setDatabaseMetadataCacheFieldsMiB(int cacheSize)
cacheSize - database metadata cache fields size (number of megabytes per connection)PGProperty.DATABASE_METADATA_CACHE_FIELDS_MIBpublic void setDefaultRowFetchSize(int fetchSize)
fetchSize - default fetch sizePGProperty.DEFAULT_ROW_FETCH_SIZEpublic int getDefaultRowFetchSize()
PGProperty.DEFAULT_ROW_FETCH_SIZEpublic void setUnknownLength(int unknownLength)
unknownLength - unknown lengthPGProperty.UNKNOWN_LENGTHpublic int getUnknownLength()
PGProperty.UNKNOWN_LENGTHpublic void setSocketTimeout(int seconds)
seconds - socket timeoutPGProperty.SOCKET_TIMEOUTpublic int getSocketTimeout()
PGProperty.SOCKET_TIMEOUTpublic void setCancelSignalTimeout(int seconds)
seconds - timeout that is used for sending cancel commandPGProperty.CANCEL_SIGNAL_TIMEOUTpublic int getCancelSignalTimeout()
PGProperty.CANCEL_SIGNAL_TIMEOUTpublic void setSsl(boolean enabled)
enabled - if SSL is enabledPGProperty.SSLpublic boolean getSsl()
PGProperty.SSLpublic void setSslfactory(String classname)
classname - SSL factory class namePGProperty.SSL_FACTORYpublic String getSslfactory()
PGProperty.SSL_FACTORYpublic String getSslMode()
PGProperty.SSL_MODEpublic void setSslMode(String mode)
mode - SSL modePGProperty.SSL_MODEpublic String getSslFactoryArg()
PGProperty.SSL_FACTORY_ARGpublic void setSslFactoryArg(String arg)
arg - argument forwarded to SSL factoryPGProperty.SSL_FACTORY_ARGpublic String getSslHostnameVerifier()
PGProperty.SSL_HOSTNAME_VERIFIERpublic void setSslHostnameVerifier(String className)
className - SSL hostname verifierPGProperty.SSL_HOSTNAME_VERIFIERpublic String getSslCert()
PGProperty.SSL_CERTpublic void setSslCert(String file)
file - SSL certificatePGProperty.SSL_CERTpublic String getSslKey()
PGProperty.SSL_KEYpublic void setSslKey(String file)
file - SSL keyPGProperty.SSL_KEYpublic String getSslRootCert()
PGProperty.SSL_ROOT_CERTpublic void setSslRootCert(String file)
file - SSL root certificatePGProperty.SSL_ROOT_CERTpublic String getSslPassword()
PGProperty.SSL_PASSWORDpublic void setSslPassword(String password)
password - SSL passwordPGProperty.SSL_PASSWORDpublic String getSslPasswordCallback()
PGProperty.SSL_PASSWORD_CALLBACKpublic void setSslPasswordCallback(String className)
className - SSL password callback class namePGProperty.SSL_PASSWORD_CALLBACKpublic void setApplicationName(String applicationName)
applicationName - application namePGProperty.APPLICATION_NAMEpublic String getApplicationName()
PGProperty.APPLICATION_NAMEpublic void setTargetServerType(String targetServerType)
targetServerType - target server typePGProperty.TARGET_SERVER_TYPEpublic String getTargetServerType()
PGProperty.TARGET_SERVER_TYPEpublic void setUsingEip(String usingEip)
usingEip - using eipPGProperty.USING_EIPpublic String getUsingEip()
PGProperty.USING_EIPpublic void setLoadBalanceHosts(boolean loadBalanceHosts)
loadBalanceHosts - load balance hostsPGProperty.LOAD_BALANCE_HOSTSpublic boolean getLoadBalanceHosts()
PGProperty.LOAD_BALANCE_HOSTSpublic void setHostRecheckSeconds(int hostRecheckSeconds)
hostRecheckSeconds - host recheck secondsPGProperty.HOST_RECHECK_SECONDSpublic int getHostRecheckSeconds()
PGProperty.HOST_RECHECK_SECONDSpublic void setTcpKeepAlive(boolean enabled)
enabled - if TCP keep alive should be enabledPGProperty.TCP_KEEP_ALIVEpublic boolean getTcpKeepAlive()
PGProperty.TCP_KEEP_ALIVEpublic void setBinaryTransfer(boolean enabled)
enabled - if binary transfer should be enabledPGProperty.BINARY_TRANSFERpublic boolean getBinaryTransfer()
PGProperty.BINARY_TRANSFERpublic void setBinaryTransferEnable(String oidList)
oidList - list of OIDs that are allowed to use binary transferPGProperty.BINARY_TRANSFER_ENABLEpublic String getBinaryTransferEnable()
PGProperty.BINARY_TRANSFER_ENABLEpublic void setBinaryTransferDisable(String oidList)
oidList - list of OIDs that are not allowed to use binary transferPGProperty.BINARY_TRANSFER_DISABLEpublic String getBinaryTransferDisable()
PGProperty.BINARY_TRANSFER_DISABLEpublic String getStringType()
PGProperty.STRING_TYPEpublic void setStringType(String stringType)
stringType - string typePGProperty.STRING_TYPEpublic boolean isColumnSanitiserDisabled()
PGProperty.DISABLE_COLUMN_SANITISERpublic boolean getDisableColumnSanitiser()
PGProperty.DISABLE_COLUMN_SANITISERpublic void setDisableColumnSanitiser(boolean disableColumnSanitiser)
disableColumnSanitiser - if column sanitizer should be disabledPGProperty.DISABLE_COLUMN_SANITISERpublic String getCurrentSchema()
PGProperty.CURRENT_SCHEMApublic void setCurrentSchema(String currentSchema)
currentSchema - current schemaPGProperty.CURRENT_SCHEMApublic boolean getReadOnly()
PGProperty.READ_ONLYpublic void setReadOnly(boolean readOnly)
readOnly - if connection should be readonlyPGProperty.READ_ONLYpublic boolean getLogUnclosedConnections()
PGProperty.LOG_UNCLOSED_CONNECTIONSpublic void setLogUnclosedConnections(boolean enabled)
enabled - true if driver should log unclosed connectionsPGProperty.LOG_UNCLOSED_CONNECTIONSpublic String getAssumeMinServerVersion()
PGProperty.ASSUME_MIN_SERVER_VERSIONpublic void setAssumeMinServerVersion(String minVersion)
minVersion - assumed minimal server versionPGProperty.ASSUME_MIN_SERVER_VERSIONpublic String getJaasApplicationName()
PGProperty.JAAS_APPLICATION_NAMEpublic void setJaasApplicationName(String name)
name - JAAS application namePGProperty.JAAS_APPLICATION_NAMEpublic boolean getJaasLogin()
PGProperty.JAAS_LOGINpublic void setJaasLogin(boolean doLogin)
doLogin - true if perform JAAS login before GSS authenticationPGProperty.JAAS_LOGINpublic String getKerberosServerName()
PGProperty.KERBEROS_SERVER_NAMEpublic void setKerberosServerName(String serverName)
serverName - Kerberos server namePGProperty.KERBEROS_SERVER_NAMEpublic boolean getUseSpNego()
PGProperty.USE_SPNEGOpublic void setUseSpNego(boolean use)
use - true if use SPNEGOPGProperty.USE_SPNEGOpublic String getGssLib()
PGProperty.GSS_LIBpublic void setGssLib(String lib)
lib - GSS mode: auto, sspi, or gssapiPGProperty.GSS_LIBpublic String getSspiServiceClass()
PGProperty.SSPI_SERVICE_CLASSpublic void setSspiServiceClass(String serviceClass)
serviceClass - SSPI service classPGProperty.SSPI_SERVICE_CLASSpublic String getSocketFactory()
PGProperty.SOCKET_FACTORYpublic void setSocketFactory(String socketFactoryClassName)
socketFactoryClassName - socket factory class namePGProperty.SOCKET_FACTORYpublic String getSocketFactoryArg()
PGProperty.SOCKET_FACTORY_ARGpublic void setSocketFactoryArg(String socketFactoryArg)
socketFactoryArg - socket factory argumentPGProperty.SOCKET_FACTORY_ARGpublic void setReplication(String replication)
replication - set to 'database' for logical replication or 'true' for physical replicationPGProperty.REPLICATIONpublic String getReplication()
PGProperty.REPLICATIONpublic String getLoggerLevel()
PGProperty.LOGGER_LEVELpublic void setLoggerLevel(String loggerLevel)
loggerLevel - of the JDBC DriverPGProperty.LOGGER_LEVELpublic String getLoggerFile()
PGProperty.LOGGER_FILEpublic void setLoggerFile(String loggerFile)
loggerFile - File output of the Logger.PGProperty.LOGGER_LEVELpublic void setConnectionExtraInfo(boolean connectionExtraInfo)
public boolean getConnectionExtraInfo()
public String getUrl()
DriverManager URL from the other properties supplied.DriverManager URL from the other properties suppliedpublic String getURL()
DriverManager URL from the other properties supplied.DriverManager URL from the other properties suppliedpublic void setUrl(String url) throws PSQLException
DriverManager URL.url - properties to setPSQLExceptionpublic void setURL(String url) throws PSQLException
DriverManager URL.
Added to follow convention used in other DBMS.url - properties to setPSQLExceptionpublic String getProperty(String name) throws SQLException
SQLExceptionpublic void setProperty(String name, String value) throws SQLException
SQLExceptionpublic String getProperty(PGProperty property)
public void setProperty(PGProperty property, String value)
protected Reference createReference()
public Reference getReference() throws NamingException
getReference in interface ReferenceableNamingExceptionpublic void setFromReference(Reference ref)
protected void writeBaseObject(ObjectOutputStream out) throws IOException
IOExceptionprotected void readBaseObject(ObjectInputStream in) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionpublic void initializeFrom(BaseDataSource source) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionpublic PreferQueryMode getPreferQueryMode()
PGProperty.PREFER_QUERY_MODEpublic void setPreferQueryMode(PreferQueryMode preferQueryMode)
preferQueryMode - extended, simple, extendedForPrepared, or extendedCacheEverythingPGProperty.PREFER_QUERY_MODEpublic AutoSave getAutosave()
PGProperty.AUTOSAVEpublic void setAutosave(AutoSave autoSave)
autoSave - connection configuration regarding automatic per-query savepointsPGProperty.AUTOSAVEpublic boolean getReWriteBatchedInserts()
PGProperty.REWRITE_BATCHED_INSERTSpublic void setReWriteBatchedInserts(boolean reWrite)
reWrite - boolean value to set the property in the properties collectionPGProperty.REWRITE_BATCHED_INSERTSpublic Logger getParentLogger()
getParentLogger in interface CommonDataSourcepublic String getXmlFactoryFactory()
public void setXmlFactoryFactory(String xmlFactoryFactory)
Copyright © 2023 openGauss. All rights reserved.