No Database Selected Dbeaver



  1. Dbeaver Sql Error No Database Selected
  2. Dbeaver No Database Selected

The CData JDBC Driver for PostgreSQL implements JDBC standards that enable third-party tools to interoperate, from wizards in IDEs to business intelligence tools. This article shows how to connect to PostgreSQL data with wizards in DBeaver and browse data in the DBeaver GUI.

Create a JDBC Data Source for PostgreSQL Data

Using DBeaver, I am able to connect to a Snowflake instance from DBeaver, but I am not able to see the list of Snowflake Databases and Schema - and thereby all other objects. Also, I found out couple of other users in the team have no issue listing Database objects in the nav-bar. Selected as Best Selected as Best. Create a JDBC Data Source for PostgreSQL Data. Follow the steps below to load the driver JAR in DBeaver. Open the DBeaver application and, in the Databases menu, select the Driver Manager option. Click New to open the Create New Driver form. In the Driver Name box, enter a user-friendly name for the driver. To add the.jar, click Add File. DBeaver is a free multi-platform database management tool for developers, SQL programmers, DBAs and analysts. It is written in Java and supports a variety of databases including MySQL, PostgreSQL. You can set a different database as active in your current connection by right-clicking in the Database Navigator pane and selecting 'Set active', below I am switching from 'postgres' to my 'reportservice' DB (this is version 6.1.2, not sure about other versions) EDIT: I have recently upgraded to version 6.3.5 and this now has 'Set as default' in the dropdown rather than 'Set active' but this seems to be roughly the.

Dbeaver sql error no database selected

Follow the steps below to load the driver JAR in DBeaver.

Selected
  1. Open the DBeaver application and, in the Databases menu, select the Driver Manager option. Click New to open the Create New Driver form.
  2. In the Driver Name box, enter a user-friendly name for the driver.
  3. To add the .jar, click Add File.
  4. In the create new driver dialog that appears, select the cdata.jdbc.postgresql.jar file, located in the lib subfolder of the installation directory.
  5. Click the Find Class button and select the PostgreSQLDriver class from the results. This will automatically fill the Class Name field at the top of the form. The class name for the driver is cdata.jdbc.postgresql.PostgreSQLDriver.
  6. Add jdbc:postgresql: in the URL Template field.

Create a Connection to PostgreSQL Data

Follow the steps below to add credentials and other required connection properties.

  1. In the Databases menu, click New Connection.
  2. In the Create new connection wizard that results, select the driver.
  3. On the next page of the wizard, click the driver properties tab.
  4. Enter values for authentication credentials and other properties required to connect to PostgreSQL.

    To connect to PostgreSQL, set the Server, Port (the default port is 5432), and Database connection properties and set the User and Password you wish to use to authenticate to the server. If the Database property is not specified, the data provider connects to the user's default database.

    Built-in Connection String Designer

    For assistance in constructing the JDBC URL, use the connection string designer built into the PostgreSQL JDBC Driver. Either double-click the JAR file or execute the jar file from the command-line.

    java -jar cdata.jdbc.postgresql.jar

    Fill in the connection properties and copy the connection string to the clipboard.

    Below is a typical connection string:

    jdbc:postgresql:User=postgres;Password=admin;Database=postgres;Server=127.0.0.1;Port=5432;

Query PostgreSQL Data

You can now query information from the tables exposed by the connection: Right-click a Table and then click Edit Table. The data is available on the Data tab.

Dbeaver Sql Error No Database Selected

Update: August 12, 2018

The following post demonstrates how to import CSVs using Dbeaver’s database to database export & import feature. If you are certain of the quality of your CSV & just want to import it quickly my subsequent post may be more useful.

0) Install DBeaver

You can find installation instructions here

1) Create a folder to be used as your CSV Database

mkdir ~/desktop/csvs

DatabaseNo Database Selected Dbeaver

Place the CSV you want to load into this folder

Dbeaver No Database Selected

2) Create a CSV database connection

In the menu bar select Database > Create a New Connection & from the list of drivers select Flat files(CSV) > CSV/DBF

Set the path of the connection to the folder you created earlier (the JDBC URL will auto-populate)

Note: If you run into trouble downloading the driver navigate to the source website and download the driver manually

3) Connect to your target database

3.1) Navigate through your target database & schema and right click on your target table and select import table data

3.2) Next select your source CSV from your CSV connection as the source container

Note: In this example case I’m loading a test CSV into a Postgres database but this functionality works with any connection that DBeaver supports (which is basically everything)

4) Ensure that the mappings of each of your columns is correct

  • For column names that are an exact match DBeaver will automatically map them for you
  • For the remaining columns make sure to map the source columns to your desired target columns

5) Complete the wizard and watch DBeaver import your data

Note: For large files it may be necessary to go get lunch but in my case 4 records doesn’t take long to import :)

6) Check to make sure that the data has loaded correctly

As a last optional step it is good practice to make sure that everything loaded correctly which can easily be done by running a query against your target DB

7) Final Notes & Thoughts

  • While this process takes a little bit more time to get setup than other tools setting up the CSV connection only needs to be done once
    • One side benefit of this as well is that you are now able to run SQL queries against CSVs very easily
  • The only real pain point that I have run across is that if you add a new CSV file or add/delete columns in an active CSV connection you have to cancel the import wizard & refresh the CSV connection for the changes to be picked up
    • this feedback was provided in issue 926 and hopefully it will be resolved in a future update

Related