Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Tomcat - Multiple hosts in JDBC connection

sai4u4everMay 30 2022

Hi Team,
I am using below configuration currently to connect database from tomcat server.
<entry key="db.hostname">server</entry>
<entry key="db.port">1521</entry>
<entry key="db.servicename">racone.world</entry>
Now , database is hosted/migrated to ODA appliance on server1 and server2. And we got below jdbc connection string
(DESCRIPTION=(CONNECT_TIMEOUT=90)(RETRY_COUNT=50)(RETRY_DELAY=3)(TRANSPORT_CONNECT_TIMEOUT=3)(ADDRESS_LIST=(LOAD_BALANCE=on)(ADDRESS=(PROTOCOL=TCP)(HOST=server1)(PORT=1521)))(ADDRESS_LIST=(LOAD_BALANCE=on)(ADDRESS=(PROTOCOL=TCP)(HOST=server2)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=racone.world)))
We have updated the datasource entry like below:

  1. commented below three entries
    #<entry key="db.hostname">server</entry>
    #<entry key="db.port">1521</entry>
    #<entry key="db.servicename">racone.world</entry>
    Added below entry
    <entry key="jdbc.url">jdbc:oracle:thin:@(DESCRIPTION=(CONNECT_TIMEOUT=90)(RETRY_COUNT=50)(RETRY_DELAY=3)(TRANSPORT_CONNECT_TIMEOUT=3)(ADDRESS_LIST=(LOAD_BALANCE=on)(ADDRESS=(PROTOCOL=TCP)(HOST=server1)(PORT=1521)))(ADDRESS_LIST=(LOAD_BALANCE=on)(ADDRESS=(PROTOCOL=TCP)(HOST=server2)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=racone.world)))</entry>
    It is not working , also tried with <entry key="db.url"> but no luck.
    Please help us to get this issue resolve.
Comments
Post Details
Added on May 30 2022
3 comments
1,237 views