DBeaver Documentation

DOWNLOAD pdf

Managing connections

This guide describes how to manage/secure DBeaver database connections. It is designed for System administrators. Regular users should check this guide.

Provide predefined connections

DBeaver keeps connections information in project folder. By default all projects reside in workspace.
Default project folder is workspace\workspace6\General.

DBeaver 6.1.3+

DBeaver keeps information about project connections in file .dbeaver/data-sources.json.
All secured information (user name, password, secret keys, etc) is stored in the encrypted file .dbeaver/credentials-config.json.

DBeaver can load multiple connection files. Any files in project folder matching .dbeaver/data-sources*.json pattern will be loaded on startup. So you can create a file, say, .dbeaver/data-sources-2.json in the project folder and DBeaver will see it.

DBeaver < 6.1.3

DBeaver keeps information about project connections in file dbeaver-data-sources.xml.

DBeaver can load multiple connection files. Any files in project folder matching .dbeaver-data-sources*.xml pattern will be loaded on startup. So you can create a file, say, .dbeaver-data-sources-2.xml in the project folder and DBeaver will see it.

Importing connections from CSV/XML

You can import connection from CSV or XML files.

CSV file must have a header row (first line of file) with column names (see list of supported columns below). XML file should contain top-level element and a set of nested elements. Connections config must be specified in attributes of nested elements. Attribute names are the same as CSV column names.

Supported names:

Name Meaning
nameConnection name
urlJDBC URL
hostDatabase server host name
portDatabase server port
databaseDatabase/schema name
userUser name
passwordUser password

You can specify just URL or set host/port/etc setting.
User name/password are options.

Sample CSV

name,host,port,server,database,url,user,password,type
Postgre Import XML 1,localhost,5432,,postgres,jdbc:postgresql://localhost:5432/postgres,postgres,postgres,dev
Postgre Import XML 2,localhost,5432,,postgres2,jdbc:postgresql://localhost:5432/postgres2,postgres2,postgres2,prod

Sample XML

&lt;connections&gt;
	&lt;connection name="Postgre Import XML 1" host="localhost" port="5432" server="" database="postgres" url="jdbc:postgresql://localhost:5432/postgres" user="postgres" password="postgres" type="dev" /&gt;
	&lt;connection name="Postgre Import XML 2" host="localhost" port="5432" server="" database="postgres" url="jdbc:postgresql://localhost:5432/postgres2" user="postgres2" password="postgres2" type="prod" /&gt;
&lt;/connections&gt;

Secure connections from editing

It is possible to make connection settings read-only (protected by password)

  • Generate MD5 hash of your password. You can do it from command line using Linux utility md5sum (md5sum &lt;&lt;&lt;"your password") or you can do it online - just google "MD5 hash online".
  • Add fieldlockPassword in connection descriptor (in .dbeaver/data-sources.json in connections element. So it will look like this:
postgres-jdbc-161537836e8-3e0957d039995715": {
   "provider": "postgresql",
   "driver": "postgres-jdbc",
   "name": "PostgreSQL - postgres",
   "save-password": true,
   "show-system-objects": true,
   "read-only": false,
   "folder": "PG",
   "lockPassword": "2ba81a47c5512d9e23c435c1f29373cb"
...
}
  • Now if user will try to change connection settings he/she will be asked for password