Connect to Oracle via Service Name instead of SID

You can give a tnsnames.ora entry-like in the string (here for SSL/TCPS):

 jdbc:oracle:thin:@(description=(address=(host=HOSTNAME)(protocol=tcp)(port=PORT))(connect_data=(service_name=SERVICENAME)(server=SHARED)))

OR

jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=yes)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=HOSTNAME)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=HOSTNAME)(PORT=1521)))(CONNECT_DATA=(SERVER=dedicated)(SERVICE_NAME=pdxdev)))

 

Here's an example of the database info in Adeptia:

 

Oracle TNSNAMES file format: tnsnames.ora entry for ORACLE database -

 PDXDEV=
  (DESCRIPTION=
    (LOAD_BALANCE=yes)
    (ADDRESS_LIST=
      (ADDRESS=
        (PROTOCOL=TCP)
        (HOST=HOSTNAME)
        (PORT=1521)
      )
      (ADDRESS=
        (PROTOCOL=TCP)
        (HOST=HOSTNAME)
        (PORT=1521)
      )
    )
    (CONNECT_DATA=
      (SERVER=dedicated)
      (SERVICE_NAME=pdxdev)
    )
  )
Have more questions? Submit a request

0 Comments

Article is closed for comments.