Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

I've written about SQL Developer on quite a few occasions, it's a tool that I use on an almost daily basis. It's improved tremendously over the years that I've been using it and apart from a few minor docking issues I can't find much fault with it...but I really wish it had an easier way to get the custom JDBC connect URL from a database connection. So if you're reading, Jeff Smith - here's a challenge for you - add a new feature that will generate a snippet of Java code from a SQL Developer database connection that will, using JDBC, connect to that database. Meanwhile, for the rest of us lets see how we can get to the JDBC URL as it stands now...

Update: Jeff did respond and I've updated this post with his solution. It can be found at the bottom of this article.

There is actually a partial JDBC URL visible in the Connection Manager already just to the right of the connection name. It's not the entire URL as required by the JDBC driver, but it can get you there if you memorised the rest of the connect string. Call me lazy, but I've never tried to memorise it so I have to refer to documentation for it.
jdbcurl_1.png


We're not done though. SQL Developer does offer the entire custom JDBC URL already...in its connection export file! For that right click on Oracle Connections, click Export Connections... and follow the wizard to generate a JSON file with all the connection details.
jdbcurl_2.png

jdbcurl_3.png

jdbcurl_4.png




The generated JSON file will contain information about your exported database connections, including their JDBC URLs. Perfect!
jdbcurl_5.png


It's not as straight forward as I'd like it, but it works.

Jeff's Solution -

Jeff's solution is a lot more straight forward. Connect to the database in question and run 'show connection'. It will display all the info you wanted, including the JDBC URL. Perfect! Thanks Jeff!
DsSkgkxXgAAE4S_.jpg-large.jpg


-i

A quick disclaimer...

Although I put in a great effort into researching all the topics I cover, mistakes can happen. Use of any information from my blog posts should be at own risk and I do not hold any liability towards any information misuse or damages caused by following any of my posts.

All content and opinions expressed on this Blog are my own and do not represent the opinions of my employer (Oracle). Use of any information contained in this blog post/article is subject to this disclaimer.
Hi! You can search my blog here ⤵
NOTE: (2022) This Blog is no longer maintained and I will not be answering any emails or comments.

I am now focusing on Atari Gamer.