Jesse
Jesse

Reputation: 3393

DB2 database in Oracle SQL developer with SSL option

Need help to connect DB2 on cloud with Oracle SQL developer. I have configured SQL developer with third party JDBC to other DBs, but not work in DB2 with SSL option.

There have no option to set "sslConnection=true" in connection dialog. I have tried db2 type 2/4 jdbc drivers, that's same result.

Upvotes: 0

Views: 2582

Answers (1)

mao
mao

Reputation: 12267

Oracle-SQL-Developer successfully lets me connect to Db2-on-cloud with SSL.

My version of Oracle-SQL-Developer is old 17.02 and yes that version seems to lack a GUI way to add connection attributes for Db2 connections . I will update this answer for version 19.02 later.

A workaround is:

  • append the required property to the database name field. Example: BLUDB:sslConnection=true; . Depending on version, the GUI may misbehave , in which case do not try a connect or test at this time, but instead try SAVE and then close Oracle-SQL-Developer - to cause it to update its connections.xml file.

  • The connection information is stored in file connections.xml which you can edit when Oracle-SQL-Developer is closed. The location of that file may depend on which operating-system you are using. For Linux it is in the .sqldeveloper tree off the home directory of the user running SQL-Devleoper . First take a backup of that file before you change it. Search for your newly created connection name. Look through the settings to find the customUrl for your Db2-on-cloud connection. You can edit it to look something like below:

    <StringRefAddr addrType="customUrl"> <Contents> jdbc:db2://dashdb-txn-sbox-***********.services.*****.bluemix.net:50001/BLUDB:sslConnection=true; </Contents>

If you made changes, save the file, take another backup of the changed file (in case it gets overwritten next time), and restart SQL-Developer. Your connection should appear in the Connections pane, and the connect should succeed if you entered all other credentials and connection-parameters correctly. Works for me...

Upvotes: 1

Related Questions