12

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

3
  • What do you want to do, please make question clear Commented Dec 26, 2014 at 6:39
  • @Exhausted- My application has more than one database in our regression environment. For load balancing between databases, I chose to use advanced 'custom JDBC URL' to connect database. E.g. custom JDBC URL 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))). If you see it has more than one database address in the URL. Commented Dec 26, 2014 at 9:52
  • use the dropdown Connection Type to find jdbc URL. select that and then enter your URL into the textbox below. Commented Apr 18, 2021 at 3:48

3 Answers 3

5

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

Sign up to request clarification or add additional context in comments.

1 Comment

Had the same problem, connection type "TNS" did not work for me as sql developer wanted the OCI libraries and I didn't have them. However, setting the connection type to "custom JDBC", having a connection string like jdbc:oracle:thin:@(...) worked for me.
0

Try this:

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

Comments

0

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();

1 Comment

It would be better to brief the content since one day the link can be outdated

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.