user1570345
user1570345

Reputation: 203

Sql developer custom connection string

How to use custom connection string in Oracle sql developer to connect?

jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)
(HOST=147.22.109.218)(port=1521))(ADDRESS=(PROTOCOL=TCP)
(HOST=147.22.109.219)(port=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=147.22.109.220)(port=1521)))
(FAILOVER=on)(LOAD_BALANCE=on)
(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=cmphpd)))

Please help. Thanks

Upvotes: 12

Views: 79322

Answers (3)

bmaupin
bmaupin

Reputation: 16015

To us a TNS connection string, in the New / Select Database Connection window where you configure the connection:

  1. Set Connection Type to TNS
  2. Under the Details tab select Connect Identifier
  3. Put the connection string into the text box next to Connect Identifier
  4. Click Test if you'd like, to make sure it works
  5. Click Save

Similarly, under Connection Type there also seems to be an option for a custom JDBC URL if that's what you prefer.

(Instructions and screenshot from version 19.4, in case it makes a difference)

enter image description here

Upvotes: 5

Gagandeep Sharma
Gagandeep Sharma

Reputation: 1

These are the best and complete instructions I've found. https://blogs.oracle.com/dev2dev/ssl-connection-to-oracle-db-using-jdbc,-tlsv12,-jks-or-oracle-wallets

Below are the steps which I took to fix this issue:

  1. Install JCE (following the instructions in Readme) - JCE
  2. Add below lines in build.gradle

    System.setProperty('oracle.net.ssl_version', '1.2') System.setProperty('oracle.net.ssl_cipher_suites', '(TLS_RSA_WITH_AES_256_CBC_SHA256)') System.setProperty('oracle.net.tns_admin', './lib') System.setProperty('oracle.net.ssl_server_dn_match', 'true')

  3. Setup db connection like

    String connString = "jdbc:oracle:thin:@(description=(address_list= (address=(protocol=tcp)(port=1521)(host=prodHost))) (connect_data=(INSTANCE_NAME=ORCL)))"; OracleDataSource ods = new OracleDataSource(); ods.setURL(connString); ods.setUser("scott"); ods.setPassword("tiger"); Connection conn = ods.getConnection();

Upvotes: 0

raz
raz

Reputation: 11

Try this:

jdbc:oracle:thin:@147.22.109.220:1521/cmphpd

Upvotes: 0

Related Questions