REQUIREMENTS
-Must use ojdbc8.jar at a minimum (Latest drivers can be downloaded from here: https://www.oracle.com/database/technologies/appdev/jdbc-ucp-19c-downloads.html)
-Requires ons.jar and ucp.jar of the same version as the JDBC driver (downloaded from the same site as ojdbc8.jar)
-context.xml must be updated to use the UCP JDBC driver
Steps to convert from JDBC to UCP driver:
-Stop Tomcat using shutdown script
-In the apache home/lib directory, remove the current ojdbc jar file (like ojdbc6.jar or ojdbc6dms.jar)
-Copy the ojdbc8.jar, ons.jar, and ucp.jar from the downloaded zip file listed above
-In the apache home/conf directory, make a backup of the context.xml file.
-Update the context.xml to look something like this:
<Resource name="jdbc/flexdbDS" auth="Container"
type="oracle.ucp.jdbc.PoolDataSource"
factory="oracle.ucp.jdbc.PoolDataSourceImpl"
connectionFactoryClassName="oracle.jdbc.pool.OracleDataSource"
minPoolSize="0"
maxPoolSize="100"
initialPoolSize="0"
autoCommit="false"
url="jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=$HOSTNAME)(PORT=$PORT)))(CONNECT_DATA=(SERVICE_NAME=$SERVICE_NAME)))"
user="fd_admin"
password="$PASSWORD"
fastConnectionFailoverEnabled="true"
connectionCachingEnabled="true"
connectionCacheProperties="{InitialLimit=0, MinLimit=0, MaxLimit=100, ConnectionWaitTimeout=60, InactivityTimeout=60, AbandonedConnectionTimeout=300, PropertyCheckInterval=30}"
validationQuery="select 1 from dual"
testOnBorrow="true"/>
$HOSTNAME should be set to the database host name
$PORT should be set to the database listener port
$SERVICE_NAME should be set to the database service name
$PASSOWRD should be set to the password of fd_admin.
Key Points:
-URL must be in the format listed in the example, the JDBC short format of host:sid:port should not be used.
-If RAC is used for the database, multiple nodes can be listed in the address list of the URL or it can point to the scan listener for the cluster. Example:
alias =(DESCRIPTION = CONNECT_TIMEOUT=120) (RETRY_COUNT=20) (RETRY_DELAY=3) (TRANSPORT_CONNECT_TIMEOUT=3) (ADDRESS_LIST =(LOAD_BALANCE=on) (ADDRESS = (PROTOCOL = TCP) (HOST=primary-scan) (PORT=1521))) (ADDRESS_LIST =(LOAD_BALANCE=on) (ADDRESS = (PROTOCOL = TCP) (HOST=secondary-scan) (PORT=1521))) (CONNECT_DATA=(SERVICE_NAME = gold-cloud)))
-Type and factory must reference the UCP driver.
-Set CONNECT_TIMEOUT to a high value to prevent logon storms.
-DO NOT use RETRY_COUNT without RETRY_DELAY
-Set LOAD_BALANCE= ON per ADDRESS_LIST to balance SCANs
-Use one DESCRIPTION and more than one causes long delays