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!

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,332 views