How to open DBF file in DBeaver with JDBC

Frantumn picture Frantumn · Mar 6, 2017 · Viewed 7.9k times · Source

I'm not sure why I can't connect to .DBF files using DBeaver with the built in JDBC driver for "Flat Tiles (CSV/DBF).

I have a share drive with dozens of DBF files on it. I create the connections as shown in the attached images, but when I connect to the source I have two issues. I've included the steps I follow and the error that I get.

Does anyone have experience connecting to DBF files with JDBC and or using the DBeaver tool that might help me here?

I did download that DANS-DBF library JAR from GitHub but I am not sure how I can use it in this situation. I noticed on this site it says

CsvJdbc requires Java version 1.6, or later. For reading DBF files, DANS DBF Library must be downloaded and included in the CLASSPATH.

But I'm not sure how I can add it to DBeaver projects. They don't use build paths like an actual java project.

(I know I can open them in excel, but I prefer this tool for data queries).

I create the database
enter image description here

I select the build in CSV DBF connection type.
enter image description here

The driver properties only had .CSV I tried it with this setting, and when it didn't work, I changed it to .dbf and it still didn't work
enter image description here

I can connect to this folder fine, and i know there are plenty of DBF files in it.
enter image description here

Settings FYI.
enter image description here

When I try to open the one DBF file that appears I get an error message. enter image description here

enter image description here

enter image description here

enter image description here

Answer

Ben picture Ben · Aug 20, 2018

I apologize for breathing life into this year and a half old post but I had the same problem and this was the first link on google.

After much research and fiddling I got DBeaver to open a .dbf flat file using most of the settings you already described.

The CSV/DBF JDBC Driver to open dbf files requires DANS DBF as you mentioned and requires its addition to the CLASS PATH. There was limited information on that process and I have found no easy way to modify that in Dbeaver. I also looked through a few other JDBC that supposedly opened xBASE files such as HXTT but they weren't free which was a deal breaker for my use.

I did however get it to work by placing the DANS DBF jar file in the same directory with the csv JDBC driver. It had no trouble finding it as a dependency and ran like a charm.

So for anyone who is looking to do this.

  • In DBeaver open the driver manager and select the csv flat file
  • download the driver if needed.
  • download DANS DBF from souce forge http://dans-dbf-lib.sourceforge.net
  • add that file to the driver and make sure you put it in the same directory as the csvjdbc driver. It should be in your user folder .dbeaver-drivers. if you click the driver file and the information button it should give you the filepath.
  • Then add the DANS DBF file to the driver manager
  • Make sure you change the file filter type to .dbf as you did otherwise it will hide all .dbf files.
  • Make a new connction and you are good to go!

a few things to note. I found that the file type extension is case sensitive so if you filter by .dbf then .DBF will not show up in the connection. A few people commented that the JDBC driver doesn't like spaces in filenames and it is a read only driver with a few quirks.