Icon

DB SQL - FoxPro Database DBF

<p>Access FoxPro DBF files with the help of KNIME nodes and Maven drivers</p>

URL: Sample FoxPro Files from Stackoverflow https://stackoverflow.com/a/31466229
URL: Access FoxPro DBF files with the help of KNIME nodes and Maven drivers - KNIME Forum (90863) https://forum.knime.com/t/connect-to-visual-foxpro-data-for-read-write/90863/3?u=mlauber71
URL: KNIME, Databases and SQL https://medium.com/p/273e27c9702a

Using FoxPro / dBASE DBF Files in KNIME (DbSchema DBF JDBC Driver)

Short setup guide

This guide describes how to enable KNIME to read DBF files (FoxPro, dBASE) using the DbSchema DBF JDBC driver.


1. Download the required JAR files

You need three JAR files:

  1. DBF JDBC Driver (main driver)
    com.wisecoders:dbf-jdbc-driver:1.1.2
    https://mvnrepository.com/artifact/com.wisecoders/dbf-jdbc-driver/1.1.2

  2. H2 Database Engine (required internally)
    com.h2database:h2
    https://mvnrepository.com/artifact/com.h2database/h2
    Recommended version: h2-2.2.224.jar

  3. javadbf library (required, exact version needed)
    com.github.albfernandez:javadbf:1.14.0
    https://mvnrepository.com/artifact/com.github.albfernandez/javadbf/1.14.0

Save all jars in a folder such as:
C:\Users<your_user>\knime-workspace-5\db_driver\


2. Add a new database driver in KNIME

Open:
File → Preferences → KNIME → Databases → Add

Set the following:

Driver ID:
FoxPro

Driver Name:
FoxPro

Database type:
default

Driver class:
com.wisecoders.dbschema.dbf.JdbcDriver

URL template:
jdbc:dbschema:dbf:/<database>

Classpath:
Add all three files:

  • dbf-jdbc-driver-1.1.2.jar

  • h2-2.2.224.jar

  • javadbf-1.14.0.jar

Click OK, then Apply and Close.
Restart KNIME (recommended).


3. Configure the DB Connector node

Use these settings:

Database Driver:
FoxPro

Database Type:
Default

Database Dialect:
SQL-92

Hostname:
(leave empty)

Port:
(leave empty)

Database name (important):
Set it to the folder containing your .dbf files, for example:
C:/Users/your_user/knime-workspace-5/Examples/DB SQL - FoxPro Database DBF/data

Do not include a file name. Each .dbf file in the folder becomes a table.

Test Connection → should be successful.


4. Query your DBF files

Use a DB Query Reader node:

Example:
SELECT * FROM customers_sample;

This will read the file customers_sample.dbf from the folder you provided.


Summary

Required libraries:

  • dbf-jdbc-driver 1.1.2

  • h2 2.2.x

  • javadbf 1.14.0 (important version)

URL format:
jdbc:dbschema:dbf:/<database>

Database name in the DB Connector = folder containing DBF files.

Access FoxPro DBF files with the help of KNIME nodes and Maven drivers

https://forum.knime.com/t/connect-to-visual-foxpro-data-for-read-write/90863/3?u=mlauber71

Testing examples from the Web

https://stackoverflow.com/a/31466229

You might have to add a suitable charset

?charset=windows-1252

?charset=cp850

?charset=iso-8859-1

?charset=iso-8859-15

?charset=cp437

?charset=utf-8

KNIME, Databases and SQL

https://medium.com/p/273e27c9702a

KNIME and Python — Setting up and managing Conda environments
https://medium.com/p/2ac217792539

customers_sample.dbf
DB Table Selector
DB Connector
locate and create /data/ folder with absolute paths
Collect Local Metadata
DB Connector
dbase_30.dbf
DB Table Selector
dbase_f5
DB Table Selector
DB Reader
DB Reader
DB Connector
DB Reader
v_dbf_pathreturn "jdbc:dbschema:dbf:/" + $${Scontext.workflow.data-path}$$ + "?charset=cp437";
Java Edit Variable (simple)
v_dbf_pathreturn "jdbc:dbschema:dbf:/" + $${Scontext.workflow.data-path}$$;
Java Edit Variable (simple)
v_dbf_pathreturn "jdbc:dbschema:dbf:/" + $${Scontext.workflow.data-path}$$ + "?charset=windows-1252";
Java Edit Variable (simple)

Nodes

Extensions

Links