GoLand 2019.1 Help

Configuring database connections

Create a connection to a database with a JDBC driver

If you cannot find a name of a database vendor in the list of data sources, download a JDBC driver for the database management system (DBMS), and create a connection in GoLand. With the JDBC driver, you can connect to DBMS and start working.

  1. Open the Database tool window (View | Tool Windows | Database) and click the Data Source Properties icon (The Data Source Properties icon).

  2. In the Data Sources and Drivers dialog, click the Add icon (The Add icon) and select Driver and Data Source.

  3. Click the Driver link.

  4. In the Driver files pane, click the Add icon and select Custom JARs.

  5. Navigate to the JAR file of the JDBC driver, select it, and click OK.

  6. In the Class field, specify the value that you want to use for the driver.

  7. Click Apply.

  8. Return to the created data source connection.

  9. Specify database connection details. Alternatively, paste the JDBC URL in the URL field.

    To set an empty password, right-click the Password field and select Set empty.

  10. To ensure that the connection to the data source is successful, click Test Connection.

Enable the single connection mode

Single connection mode means that the data source and all consoles use one and the same connection. This mode allows you to see the temporary objects in the database tree, or use the same transaction in different consoles. For more information about consoles, read Database Console.

  1. Open the Database tool window (View | Tool Windows | Database) and click the Data Source Properties icon (The Data Source Properties icon).

  2. Select the data source where you want to enable the single connection mode.

  3. Click the Options tab.

  4. Select Single connection mode.

  5. Click Apply.

Enable the single connection mode

Assign a color to a data source

You can assign a color to a data source (for example, for better differentiation between production and test databases).

  1. Open the Database tool window (View | Tool Windows | Database) and click the Data Source Properties icon (The Data Source Properties icon).

  2. Select the data source for which you want to assign a color.

  3. Click the Choose color icon (The Choose color icon) and select a color.

  4. Click OK.

Assign a color to a data source

Connect to a database with SSL

  1. Open the Database tool window (View | Tool Windows | Database) and click the Data Source Properties icon (The Data Source Properties icon).

  2. Select a data source profile where you want to change connection settings.

  3. Click the SSH/SSL tab and select the Use SSL checkbox.

  4. In the CA file field, navigate to the CA certificate file (for example, ca.pem).

  5. In the Client certificate file field, navigate to the client certificate file (for example, client-cert.pem).

  6. In the Client key file field, navigate to the client key file (for example, client-key.pem).

  7. To ensure that the connection to the data source is successful, click Test Connection.

Connect to a database with SSL

Connect to a database with SSH

  1. Open the Database tool window (View | Tool Windows | Database) and click the Data Source Properties icon (The Data Source Properties icon).

  2. Select a data source profile where you want to change connection settings.

  3. Click the SSH/SSL tab and select the Use SSH tunnel checkbox.

  4. In Proxy host, Proxy user, Proxy password, and Port fields, specify connection details.

  5. From the Auth type list, select an authentication method:

    • Password: to access the host with a password. Specify the password, and select the Save password checkbox to save the password in GoLand.

    • Key pair (OpenSSH or PuTTY): to use SSH authentication with a key pair. To apply this authentication method, you must have a private key on the client machine and a public key on the remote server. GoLand supports private keys that are generated with the OpenSSH utility.

      Specify the path to the file where your private key is stored and type the passphrase (if any) in the corresponding fields. To have GoLand remember the passphrase, select the Save passphrase checkbox.

    • OpenSSH config and authentication agent: to use SSH keys that are managed by a credentials helper application (for example, Pageant on Windows or ssh-agent on Mac and Linux).

  6. To ensure that the connection to the data source is successful, click Test Connection.

SSH and SSL settings of a data source

Add a JDBC driver to an existing connection

  1. Open the Database tool window (View | Tool Windows | Database) and click the Data Source Properties icon (The Data Source Properties icon).

  2. In the Data Sources and Drivers dialog, select a data source where you want to change a driver, and click the Driver link in data source settings.

  3. In the Driver files pane, click the Add icon (The Add icon) and select Custom JARs.

  4. Navigate to the JAR file of the JDBC driver, select it, and click OK.

  5. In the Class field, specify the value that you want to use for the driver.

  6. Click Apply.

Remember password

You can select the following options for storing your password:

  • Never: password is prompted each time you establish a connection with a database.

  • Until restart: password is saved only for the current GoLand run. If you exit GoLand and open it again, you must provide the password again.

  • For session: password is saved only for the current connection session with a database (until you disconnect from it). You can terminate the connection by pressing the Disconnect icon (the                     Disconnect icon) or Ctrl+F2.

  • Forever: password is saved in the GoLand storage. You do not need to provide the password next time you open GoLand.

Last modified: 27 March 2019