Reading Paradox Files

Back in the day, Paradox was a pretty amazing database.  I recently had a reason to read some Paradox files for a friend, who had a client with a Paradox database.  They needed their data out of the database to insert into something more modern.

Googling for the file format of a Paradox DB didn’t turn up much, other than this excellent document written in 1996.  It was enough to give me a good start.  I also found some sample DB files, interestingly from the Paradox documentation.

The end result was paradoxReader, which you can download here.  It handles most of the data types other than BLOBs, so far.  The documentation on how to use it is here.  It uses the visitor pattern, which means all you need to do is pass it an InputStream to a .db file, and implement a single interface which is called once per row, with the row data.

The default implementation currently outputs CSV for each table, however it wouldn’t be difficult to have it output SQL or even just connect to a JDBC database and insert the data into a table.

Similar Posts

  • jvmBasic 2.0

    I’ve always had a fascination with compilers.  As a Java geek, I’m also quite interested in the JVM.  In order to learn a little more about both, and as a way to contribute to the open source world, I decided to implement a compiler for BASIC.   So, jvmBasic consumes BASIC code and emits .class…

  • Ebean-DAO

    When building database ORM code, I prefer to use ebean, and I prefer to use DAO‘s. Since DAO’s are simple to make generic, I have a Generic DAO I use for all projects. I’ve finally decided to open-source my DAO code, and you can find it here https://github.com/teverett/ebean-dao.

  • Building a simple RIAK ORM

    I’ve been interested in RIAK for a while, and ORM’s are nothing short of fascinating. I decided to try writing an ORM for Riak, and the results are here: https://github.com/teverett/cbean My ORM is not an ORM of course, because RIAK is not relational. However it is ORM-like; I can store POJO’s and retrieve them. The…

  • Bioinformatics data

    I recently had a chance to learn a little about Bioinformatics, and ended up browsing the NIH’s database of genomes here.  Inside the genome data for any particular strain of a species, you’ll find various files with file extensions like “ffa”, “fna”, “ffn” and “frn”.  These are FASTA files. If you’d like an example, here’s…

4 Comments

  1. Hi,

    This is great!
    I recive a Exception:
    Caused by: java.lang.Exception: Unknown field type ‘4’
    at com.khubla.pdxreader.db.DBTableField.readFieldTypeAndSize(DBTableField.java:119)
    … 5 more

    I can see that FieldType 4 is missing. Do you know whay you fiealdType 4 is not implemented?

    BR
    Mats Ahlbom

    1. Hi!

      I also use this great library to read old paradox db files and faced the same problem. But I’ve fixed this with little patch of the lib. Unknown field type ‘4’ is an integer type, there is also type ’21’ missing for timestamp fields.

      I supported two new FieldType enum values and their handling in DBTableValue and that’s worked.

  2. Hi,
    I am getting a block size error (16) with some of the DB files I try to process. Just in case someone ran into the same issue and has a solution.
    Tom, I sent you an email with a sample.
    Thanks,
    Marc

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.