Working with ODBC Data in DBeaver
DBeaver is a database management tool and SQL client that runs on Windows, Linux, OS X and UNIX (AIX, HP-UX and Solaris) platforms.
The DBeaver SQL editor has auto completion and database-specific syntax highlighting to facilitate the creation, analysis, and debugging of complex queries.
To save its users' time, DBeaver provides SQL templates, which are snippets of commonly used SQL code. To insert the contents of a template into the SQL editor, you simply type the template's name and press the TAB key.
You can use DBeaver to save tables or query results in several formats such as CSV, SQL "Insert" statements and HTML. For example, to export your query results as web page tables, right-click on the Results view in DBeaver, select Export Resultset, and then click Export to HTML.
DBeaver can be installed either on the database server or on a remote machine. The ability to use DBeaver as a remote database manager makes it easy to administer multiple databases on multiple platforms from a single location.
Other DBeaver features include:
- The ability to browse and edit database metadata (tables, columns, keys and indexes).
- BLOB/CLOB support.
- Scrollable resultsets.
- The ability to search database objects (tables, columns, constraints and procedures).
- Entity relationship (ER) diagrams.
DBeaver is written in Java. To interact with a database, a Java application uses a JDBC driver. JDBC is a Java application programming interface (API) that connects Java to relational databases (and other tabular data, such as spreadsheets and flat files). A JDBC driver implements the JDBC API for a particular database. To access a database by using an ODBC driver, DBeaver uses a JDBC-ODBC Bridge driver to convert between ODBC and JDBC calls. For example, DBeaver can use the JDBC-ODBC Bridge that used to be included in the Java distribution. However even if you can get that combination to work (we couldn't — the connection failed either with a Java error or an ODBC Driver Manager error), there are some issues associated with the Java JDBC-ODBC Bridge. For example, it was never intended for production use and we have found that with some applications, NULLs are returned when Unicode column values are queried.
As an alternative solution, the Easysoft JDBC-ODBC Bridge is a client server product that enables a Java application such as DBeaver to access an ODBC database such as Microsoft Access. The client part of the Easysoft JDBC-ODBC Bridge is a JDBC driver. On Windows, the sever part is a Windows service that acts as an ODBC application.
The rest of this blog documents how to use the Easysoft JDBC-ODBC Bridge to access data from an ODBC database in DBeaver.
- Configure a System ODBC data source for the database that you want to connect to in DBeaver.
To do this, use the 32-bit version of ODBC Data Source Administrator on your DBeaver machine. On some versions of Windows, this is located in Control Panel > Administrative Tools. On some version of Windows, you need to search for ODBC in the taskbar search box. The 32-bit version of ODBC Data Source Administrator should be clearly labelled. If in doubt, in the Windows Run dialog box, type:
- Download the Easysoft JDBC-ODBC Bridge. (Registration required.)
- Install and license the Easysoft JDBC-ODBC Bridge on the machine where the DBeaver is installed.
For installation instructions, see the Easysoft JDBC-ODBC Bridge documentation.
- In DBeaver, choose Database > Driver Manager
The Driver Manager dialog box is displayed.
- Choose New
The Create new driver dialog box is displayed.
- Choose Add File.
The Open driver library dialog box is displayed.
- Browse for the Easysoft JDBC-ODBC Bridge JAR file, EJOB.jar.
EJOB.jar is installed in the following location on the machine where you installed the Easysoft JDBC-ODBC Bridge:
On 64-bit Windows, the default location for <easysoft_install> is <drive>:\Program Files (x86)\Easysoft Limited\Easysoft JDBC-ODBC Bridge.
On 32-bit Windows, the default location for <easysoft_install> is <drive>:\Program Files\Easysoft Limited\Easysoft JDBC-ODBC Bridge.
- Complete the dialog box fields:
Field Value Driver Name Easysoft JDBC-ODBC Bridge Driver easysoft.sql.jobDriver URL Template jdbc:easysoft://localhost/data_source:logonuser=windows_user:logonpassword=password
- Right-click the Database Navigator pane. From the pop-up menu, choose Create New Connection.
The Create new connection wizard starts.
Easysoft JDBC-ODBC Bridgein the space provided, and then choose Next.
- If your database requires a user name and password, enter these connection details in the spaces provided.
- In the wizard's final screen, name the connection and choose a connection type. Choose Finish.
- Right-click the new connection the Database Navigator pane. From the pop-up menu, choose SQL Editor.
- Type a query in the right pane. Press CTRL+ENTER to execute the query.