Skip to main content

Command Palette

Search for a command to run...

Oracle SQLcl's new feature - SAVE connections. Finally, I can use it as often as I'm using SQL Developer.

Updated
2 min read
Oracle SQLcl's new feature - SAVE connections. Finally, I can use it as often as I'm using SQL Developer.
R

Oracle APEX & PL/SQL Developer with 10 years of experience in IT, including financial systems for government administration, energy, banking and logistics industry. Enthusiast of database automation. Oracle ACE Associate. Certified Liquibase database versioning tool fan. Speaker at Kscope, APEX World, SOUG, HrOUG, POUG and DOAG. Likes swimming in icy cold lakes in winter and playing basketball.

Do you know what always annoyed me about SQLcl? Manual input of my database details, such as connection string, username, and password.

I've always missed something that SQL Developer had for a long time - the SAVE CONNECTION feature.

And guess what? Yesterday's new 23.2 version of SQLcl changed it all (SQLcl release notes and docs, also introduced on Jeff's Smith blog)

Watch this.

Until yesterday, my connection looked like that:

sql rgrzegorczyk/PASSWORD@localhost:1521/XE
--or that if I had my  TNSNAMES configured
sql rgrzegorczyk/PASSWORD@MY_CONNECTION

Save your connection using the new CONNMGR feature (Managing stored connections)

Connect to your database using SQLcl as usual.

--on premise
sql rgrzegorczyk/PASSWORD@localhost:1521/XE
--walltet
sql /nolog
conn RAFAL/PASSWORD@rgatp_medium
--type SHOW TNS to see configured TNS connections

Save it!

conn -save MY_CONNECTION2 -savepwd

Skip -savepwd if you don't want to save the password.

Before saving the connection remember to connect with a string like***username/password@host:port/sid.***Otherwise, you won't be able to save a password for your connection.

Connect with ease!

According to the documentation, shorthand notation (i.e -n for -name ) should also be supported. However a bug has been logged for version 23.2

List your stored connections:

Preview saved connections:

Test your connection

Change the details of your saved connection (proceed like with saving the new connection but add REPLACE param)

Import connections from SQL developer:

It didn't work for me. I will update it after receiving an answer from Oracle.

Delete saved connections:

Missing feature, but you can delete it manually:

Windows

%APPDATA%\DBTools\connections

or

C:\Users\\AppData\Roaming\DBTools

Mac -> users/your_user/.dbtools/connections

Update 16.06.2026

Now, you can easily import/export connections using SQLcl built-in VS Code. Check this blog post by Tomas link

M

This art is great and useful :) Thanks Rafał!

More from this blog

Keep It Simple. Developer's tips.

53 posts