Package oracle.jdbc
Interface OracleConnectionStringBuilder
public interface OracleConnectionStringBuilder
- Since:
- 20c
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classThis class represents the ADDRESS node of the TNS Connect String. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionaddConnectInfo(String host, int port) Creating a new ConnectInfo using the given host and port value and adds to the ConnectInfoList.addConnectInfo(OracleConnectionStringBuilder.ConnectInfo connectInfo) Adds the given ConnectInfo to the ConnectInfoList which will be used for creating the TNS connect string.build()Builds the TNS ConnectString using the provided values and returns the built value.It works the same way asbuild(), but It adds the prefix required by the JDBC Thin Driver to resolve the driver type.connectTimeout(int connectTimeout) Used to configure the value of CONNECT_TIMEOUT in the DESCRIPTION node.instanceName(String instanceName) Used to configure the value of INSTANCE_NAME in the CONNECT_DATA node.loadBalance(boolean loadBalance) Used to configure the value of LOAD_BALANCE in the ADDRESS_LIST node.Factory method for creating a new instance of OracleConnectionBuilder.retryCount(int retryCount) Used to configure the value of RETRY_COUNT in the DESCRIPTION node.retryDelay(int retryDelay) Used to configure the value of RETRY_DELAY in the DESCRIPTION node.Used to configure the value of SSL_SERVER_CERT_DN in the SECURITY node.serverMode(String serverMode) Used to configure the value of SERVER in the CONNECT_DATA node.serviceName(String serviceName) Used to configure the value of SERVICE_NAME of the CONNECT_DATA node.transportConnectTimeout(int transportConnectTimeout) Used to configure the value of TRANSPORT_CONNECT_TIMEOUT in the DESCRIPTION node.walletDirectory(String walletDirectory) Used to configure the value of MY_WALLET_DIRECTORY in the SECURITY node.
-
Field Details
-
SERVER_MODE_DEDICATED
- See Also:
-
SERVER_MODE_SHARED
- See Also:
-
SERVER_MODE_POOLED
- See Also:
-
PROTOCOL_TCP
- See Also:
-
PROTOCOL_TCPS
- See Also:
-
PROTOCOL_WSS
- See Also:
-
PROTOCOL_BEQ
- See Also:
-
-
Method Details
-
newInstance
Factory method for creating a new instance of OracleConnectionBuilder.- Returns:
- oracleConnectionBuilder
-
addConnectInfo
Adds the given ConnectInfo to the ConnectInfoList which will be used for creating the TNS connect string. The ConnectInfo is ADDRESS part of the TNS Connect String. A connect string can have more than one ADDRESS nodes. Please see the below example to know how to create a new OracleConnectionStringBuilder.ConnectInfo instance.ConnectInfo connectInfo = ConnectInfo .newInstance() .host("mydbhost") .port(5521) .protocol(OracleConnectionStringBuilder.PROTOCOL_TCP);- Parameters:
connectInfo-- Returns:
- oracleConnectionBuilder
-
addConnectInfo
Creating a new ConnectInfo using the given host and port value and adds to the ConnectInfoList. The Protocol will be "TCP" by default. To configure ConnectInfo with different parameters useaddConnectInfo(ConnectInfo).- Parameters:
host-port-- Returns:
- oracleConnectionBuilder
-
serviceName
Used to configure the value of SERVICE_NAME of the CONNECT_DATA node.- Parameters:
serviceName-- Returns:
- oracleConnectionBuilder
-
serverMode
Used to configure the value of SERVER in the CONNECT_DATA node. Following are the valid values,SERVER_MODE_DEDICATEDSERVER_MODE_POOLEDSERVER_MODE_SHARED- Parameters:
serverMode-- Returns:
- oracleConnectionBuilder
-
instanceName
Used to configure the value of INSTANCE_NAME in the CONNECT_DATA node.- Parameters:
instanceName-- Returns:
- oracleConnectionBuilder
-
serverDN
Used to configure the value of SSL_SERVER_CERT_DN in the SECURITY node. Configured value will be used for validating the server certificate while connection establishment. This value is used only if the protocol is "TCPS".- Parameters:
serverDN-- Returns:
- oracleConnectionBuilder
-
walletDirectory
Used to configure the value of MY_WALLET_DIRECTORY in the SECURITY node. This value is used only if the protocol is "TCPS" or "WSS".- Parameters:
walletDirectory-- Returns:
- oracleConnectionBuilder
-
loadBalance
Used to configure the value of LOAD_BALANCE in the ADDRESS_LIST node. Setting it to false will disable the load balancing. The default value is true.- Parameters:
loadBalance-- Returns:
- oracleConnectionBuilder
-
connectTimeout
Used to configure the value of CONNECT_TIMEOUT in the DESCRIPTION node. This is the maximum time allowed for establishing the connection to the Oracle Database.The value is in seconds.- Parameters:
connectTimeout-- Returns:
- oracleConnectionBuilder
-
transportConnectTimeout
Used to configure the value of TRANSPORT_CONNECT_TIMEOUT in the DESCRIPTION node. The TRANSPORT_CONNECT_TIMEOUT parameter specifies the time, in seconds, for a client to establish a TCP connection to the Oracle Database Server.- Parameters:
transportConnectTimeout-- Returns:
- oracleConnectionBuilder
-
retryCount
Used to configure the value of RETRY_COUNT in the DESCRIPTION node.- Parameters:
retryCount-- Returns:
- oracleConnectionBuilder
-
retryDelay
Used to configure the value of RETRY_DELAY in the DESCRIPTION node.- Parameters:
retryDelay-- Returns:
- oracleConnectionBuilder
-
build
Builds the TNS ConnectString using the provided values and returns the built value. ThrowsIllegalStateExceptionif any of values provided for building the connect string is invalid.- Returns:
- tnsConnectString
- Throws:
IllegalStateException
-
buildThinStyleURL
It works the same way asbuild(), but It adds the prefix required by the JDBC Thin Driver to resolve the driver type.- Returns:
- tnsConnectString
- Throws:
IllegalStateException
-