If you’re using a password technology that integrates with desktop applications, then you probably want to also secure your Oracle Database connections.
Many of these work with command line interfaces for launching said applications, then they can inject their magic and handle the user interaction when it comes to supplying the password.
So we frequently see requests like this –
We would like the ability to launch SQL Developer with command line parameters such as a userid/password and connect string similar to what can be done today with SQLcl…Customer #12345
Well, now you can do just that in version 20.2
One of our developers in their spare time put together an open source utility that allows you submit connection requests from outside of SQL Developer.
But, I’m going to give you the boiled down, TL;DR version, right here and right now.
Configure Check for Updates
We’re going to pull down an extension that allows SQL Developer to both listen for and make connection requests.
In the main menu of SQL Developer, open, Help – Check for Updates.
You’re going to to ADD a new Update Center.
For the location, enter this URL
Make sure your new entry is checked before you hit next. If you ONLY want to see our open source extensions, make sure it’s the ONLY thing checked.
Click Next and confirm the install by hitting ‘Finish
When it’s done, it’ll ask to Restart SQLDev, say ‘Yes.’
Configuring SQL Developer
When SQL Developer has come up, we’re going to go into the preferences.
You’re going to at a minimum enable the first and third option, and confirm the port you want SQL Developer to listen for connection requests on.
By default, the connections coming in will be transient…that is, if you close and re-open SQL Developer, you won’t see them there in your Connection Panel.
Enabling ‘Persist’ will make those permanent additions to your SQL Developer configuration.
After clicking ‘Ok’, if you open the View – Task Progress panel, you’ll see there’s a new task running.
For this to work for your secure password scenario, you’re going to make at least one, if not two calls.
First, SQL Developer needs to be already open, with this Connection Helper task running. You can achieve that by making a call to SQL Developer from your bash or cmd prompt or simply open it like you always would from your Applications or Start Menu/shortcut.
Once it’s running, you can make another call to create/make the connection.
Making the connection from the CLI.
I’m on Windows, but since this is Java, it’ll be the same as on your Mac or Linux desktops.
Part of what was installed when you added this extension was a Connection Helper Client, a jar file.
This file goes here –
With the jar file located, we can now make our connection.
Open a terminal/cmd, and cd to that directory.
java -jar ConnectionHelperClient.jar -HelperClientDemo2=hr/[email protected]:1521/orcl or java -jar ConnectionHelperClient.jar [email protected]:1521/orcl
Here’s an animated GIF of me using the feature.
Note that I have already made one connection, that’s why you see the call already there when I bring up the CMD window and why you already see a connection folder called ‘Transient’ with a similar connection going.
Transient vs Persistent Connections
If I close and re-open SQL Developer, i’ll see my Connection Helper task, but I won’t see my previous connections made with it. That’s because we left the ‘Persist’ options disabled in the preferences.