Skip to content

Starting the GUI from the Command Line (dbvisgui)

You can start DbVisualizer from a terminal or a script, for example to open a workspace or connect to a database at startup. Use the following script in the installation folder, DBVIS-HOME:

# Windows:
DBVIS-HOME\dbvisgui.bat

# Linux:
DBVIS-HOME/dbvisgui.sh

# macOS:
/Applications/DbVisualizer.app/Contents/Resources/app/dbvisgui.sh

To run SQL scripts without the user interface, use the command-line interface instead.

Opening a workspace, connection or script at startup

ArgumentDescription
-workspace <directory>Opens the workspace in the folder.
-connection <name>Connects to the connection with this name.
-userid <userid>The user name to connect with, instead of the one saved in the connection.
-password <password>The password to connect with, instead of the one saved in the connection.
<filename>Opens the SQL script in SQL Commander. With -connection, the script uses that connection.
-encoding <encoding>The encoding of the SQL script.
-windowtitle <title>Text to add to the window title, for example to tell several DbVisualizer windows apart.

For example, on Windows:

dbvisgui.bat -workspace D:\work\customer1 -connection "Sales DB" D:\scripts\report.sql

To list the arguments, run the script with -help. They are also listed in the Command Line tab of Help → About.

Setting the Java runtime and Java VM options

When you start DbVisualizer using the script, the Java VM options set in Tool Properties are not used. Instead, you set them in environment variables before you run the script. Set them in the environment, not in the script, so that they are kept when you upgrade.

To pass options to the Java VM, set VM_ARGS. They are added after the default options, so they take precedence. This also works for dbviscmd. For example, to give DbVisualizer more memory:

# Windows:
set VM_ARGS=-Xmx8g
dbvisgui.bat

# Linux and macOS:
VM_ARGS="-Xmx8g" ./dbvisgui.sh

The script uses the Java runtime that comes with DbVisualizer, or, if there is none, the first java executable found in the PATH. To use another Java installation, set JAVA_EXEC to its java executable, for example set JAVA_EXEC=D:\java\jdk\bin\java.exe on Windows. If the Java version isn't supported, the script stops with a message.