Database driver IBM Db2
Table of contents
This guide provides instructions on how to set up and use IBM DB2 with DBeaver.
Before you start, you must create a connection in DBeaver and select IBM DB2. If you have not done this, please refer to our Database Connection article.
DBeaver interacts with the IBM DB2 server using a specific driver, it supports all versions of IBM DB2, but the correct driver must be selected: use Db2 for LUW (Old 8.x) for versions below 8.x and Db2 for LUW for newer versions. DBeaver also supports various IBM DB2 databases such as Db2 for IBM i, and Db2 for z/OS. You must select the appropriate driver in the Connect to a database window for these databases.
This section provides an overview of DBeaver's settings for establishing a direct connection and the configuration of secure connections using SSH, proxies, SSL, and the setup of ODBC/JDBC drivers for Db2.
Db2 connection settings
In this subsection, we will outline the settings for establishing a direct connection to a Db2 database using DBeaver. Correctly configuring your connection ensures seamless interaction between DBeaver and your Db2 database.
The page of the connection settings requires you to fill in specific fields to establish the initial connection.
|Connect by (Host/URL)||Choose whether you want to connect using a host or a URL.|
|Driver Type||Select the appropriate driver for your Db2 database.|
|URL||If you are connecting via URL, enter the URL of your Db2 database here. This field is hidden if you are connecting via the host.|
|Host||If you are connecting via host, enter the host address of your Db2 database here.|
|Database||Enter the name of the Db2 database you want to connect to.|
|Port||Enter the port number for your Db2 database.|
|Authentication||Choose the type of authentication you want to use for the connection. For detailed guides on authentication types, please refer to the following articles:|
- Native Database Authentication
- DBeaver Profile Authentication
|Connection Details||Provide additional connection details if necessary.|
|Driver Name||This field will be auto-filled based on your selected driver type.|
|Driver Settings||If there are any specific driver settings, configure them here.|
The Connection Details section in DBeaver allows for further customization of your Db2 connection. This includes options for adjusting the Navigator View, setting up Security measures, applying Filters, configuring Connection Initialization settings, and setting up Shell Commands. Each of these settings can significantly impact your database operations and workflow. For detailed guides on these settings, please refer to the following articles:
- Connection Details Configuration
- Database Navigator
- Security Settings Guide
- Filters Settings Guide
- Connection Initialization Settings Guide
- Shell Commands Guide
In DBeaver, the trace settings feature allows you to monitor and record database operations in a detailed manner. To enable this feature, check the Enable trace box. You will need to specify a file where the traced information will be stored and formatted into a readable format.
The trace settings page allows you to configure various levels and settings to tailor the tracing process according to your preferences.
|Folder/File name||Specify the directory and file name where the trace data will be stored. This file will contain detailed information about the operations performed in the database.|
|Append||This option allows you to add information to an existing trace file, instead of creating a new file each time the trace is enabled.|
|Connection Calls||Records calls related to database connections.|
|Result Set Calls||Records calls pertaining to the result sets.|
|Connects||Records information about database connects.|
|Result Set Metadata||Records metadata information from the result sets.|
|Diagnostics||Records diagnostic information about database operations.|
|XA Calls||Records information on XA distributed transactions.|
|Statement Calls||Records calls related to SQL statements.|
|Driver Configuration||Records configuration details of the database driver.|
|DRDA Flows||Records information on DRDA data flows.|
|Parameter Metadata||Records metadata about SQL parameters.|
|SQL J||Records information on SQL J operations.|
For more detailed information on these settings, please refer to the IBM documentation.
Db2 driver properties
The settings for Db2 Driver properties enable you to adjust the performance of the Db2 JDBC and ODBC driver. These adjustments can influence the efficiency, compatibility, and features of your Db2 database.
For a complete walkthrough on setting up Db2 JDBC and ODBC drivers properties, you can refer to the official Db2 JDBC documentation and Db2 ODBC documentation. These guides detail each driver's properties and how they can be used to optimize Db2 database connections.
You can customize the Db2 driver in DBeaver via the Edit Driver page, accessible by clicking on the Driver Settings button on the first page of the driver settings. This page offers a range of settings that can influence your Db2 database connections. For a comprehensive guide on these settings, please refer to our Database drivers article.
ODBC and JDBC Driver Configuration
DBeaver provides extensive capabilities for managing Db2 database connections via ODBC/JDBC drivers. This functionality enables you to connect to your Db2 database using native ODBC drivers, offering an alternative when specific DBeaver drivers are not available.
You can find a comprehensive, step-by-step guide on how to install the driver manager, set up drivers, configure data sources, and establish connections in DBeaver in our ODBC Driver Configuration article.
Secure Connection Configurations
DBeaver supports secure connections to your Db2 database. Guidance on configuring such connections, specifically SSH, Proxy, SSL and Kubernetes connections, can be found in various referenced articles. For a comprehensive understanding, please refer to these articles:
Powering Db2 with DBeaver
DBeaver provides a host of features designed for Db2 databases. This includes the ability to view schemas, along with numerous unique capabilities aimed at optimizing database operations.
Db2 database objects
DBeaver lets you view and manipulate a wide range of Db2 database objects. DBeaver has extensive support for various Db2 metadata types, allowing you to interact with a wide variety of database objects, such as:
- Unique Constraints
- Foreign Keys
- Check Constraints
- Columns Masks
- XML Schemas
- Application Objects
- User Defined Types
- Remote Servers
- User Mappings
- Global metadata
- XML Strings
- Storage Groups
- Session Manager
Db2 Features in DBeaver
DBeaver is not limited to typical SQL tasks. It also includes numerous unique features specifically for DB2. Beyond regular SQL operations, DBeaver provides a range of Db2-specific capabilities, such as:
|Global Metadata||XML Strings|
Additional features compatible with Db2, but not exclusive to it:
|Data Transfer||Data Import|
|Session Management||Session Manager|
|Lock Management||Lock Manager|
|Schema Management||Schema Compare|
|Data Visualization||GIS Guide|