Yesterday was an exciting day, we finally released our Oracle SQL Developer Extension for VS Code!

One of the first things you need to do to start using the extension is to create your first connection. And this immediately raises a very obvious questions.

Hey, I already defined these in SQL Developer, so…?

In an update coming soon, we’ll automatically import your existing connections from SQL Developer to the extension in VS Code, you won’t have to do anything. Believe me, I wanted this in v1, but I also wanted to ship this extension, and so we had to draw a line.

The good news is there’s a very easy workaround!

SQLcl makes this possible.

We’re going to use a ‘man in the middle,’ but in a good way! SQLcl and our Extension SHARE connections. That means, if you have a connection defined in SQLcl, it will appear in VS Code!

Of course Martin was already using the new connections feature in SQLcl!

What does this mean, or what does it look like?

These connections are defined once, and shared with our database tools offerings.

OK, so how do we get them into SQLcl?

Well, first you need to export them from SQL Developer (Classic).

I’m just going to export/import SOME of my connections.

I’m going to optionally include the passwords, protecting with yet another password, and then save to a file on my Desktop.

Grab what you want…

Now that we have the file, we can import them in SQLcl.

I’ve already shown how to do this in a post, here. But hey, let’s do it again.

Cool, I have more connections now to play with.

I should test one of those, right quick?

Insert Homer “Woohoo!”

Ok, now over to my VS Code instance with my SQL Developer Extension.

Just hit the “Refresh” button in your connections panel, and wait a second or 3…

There we go!

Awesome, my connections are there! They work, and if open the properties, I can see they are what they’re supposed to be.

A few notes on connections

They’re stored securely, using Wallets

On Windows, look here –

C:/users\yourUser\AppData\Roaming\DBTools\connections

On your Mac, they’ll be in your $HOME/.DBTools folder, so something like

/Users/thatjeffsmith/.DBTools/connections

I have lots of connections, where are the folders??

For organizing many, many connections, this is very handy! And we agree, it’ll be coming later this year.

Same on being able to differentiate connections, by something LIKE coloring them as we did in SQL Developer Classic. Stay tuned.

What about Proxy or LDAP connections, I don’t see that connection type?

We’ll have formal GUI support for those also later this year, although it’s possible to create those connections RIGHT NOW.

For PROXY connections, just use the [user] syntax like Moritz shows here –

And for LDAP (and most any other type of connections, you can use the JDBC Url connection type) as a workaround.

Be careful talking to me in public, I might quote you here.

You would use something like this, as shown in the docs

jdbc:oracle:thin:@ldap://oid:5000/mydb1,cn=OracleContext,dc=myco,dc=com

But Jeff, all of this is great, but I don’t have SQLcl!!!

Yes, yes you do, you do if you have either SQL Developer OR the VS Code Extension. We ship SQLcl in both of those!

You officially have ZERO reasons now for NOT taking advantage of the command line 🙂
Author

I'm a Distinguished Product Manager at Oracle. My mission is to help you and your company be more efficient with our database tools.

3 Comments

  1. Alessandro Reply

    Hello Jeff.
    This saved me a lot of time, really really thank you!

    However, after installing the extension I couldn’t open SQLc from VSCode. Even trying to open it from the terminal list, it opened a powershell instead.
    It worked for me only after setting up manually 1 first working connection. Not a big deal, but if it’s not just me it could be added to the guide.

    Thanks again,
    Alessandro

  2. Mikael Fransson Reply

    /Users/thatjeffsmith/.DBTools/connections

    Should probably be

    /Users/thatjeffsmith/.dbtools/connections

    No .folder on my mac uses capitals.

    Feature request, add a delete function for the connmgr or put it in VS Code.

    Thanks
    Mikael

Write A Comment