Skip to content

arneke/dans-dbf-lib

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dans-dbf-lib

DANS DBF Library - Java classes to read, write and update DBF database files.

DESCRIPTION

DANS DBF is a Java library for reading, writing and updating the contents of old DBF (dBase) databases. It was produced for the MIXED project. It is no longer maintained. You are however free to fork it, if you wish.

DANS DBF requires Java 1.5, or later, and has no dependencies.

The following program demonstrates how the library is used.

import nl.knaw.dans.common.dbflib.*;

import java.io.File;
import java.util.Iterator;
import java.util.List;

public class DansDbfDemo
{
  public static void main(String []args) throws Exception
  {
    File dbfFile = new File("src/test/resources/dbase3plus/cars/cars.dbf");
    Table table = new Table(dbfFile);
    table.open(IfNonExistent.ERROR);
    List<Field> fields = table.getFields();
    Iterator<Record> it = table.recordIterator();
    while (it.hasNext())
    {
      Record record = it.next();
      for (Field field: fields)
      {
        System.out.print(field.getName());
        System.out.print(": ");
        System.out.print(field.getType());
        System.out.print(": ");
        System.out.println(record.getTypedValue(field.getName()));
      }
    }
    table.close();
  }
}

The project does contain configuration for building a Maven site. However, it is currently broken. At sourceforge there may still be a version of this site.

About

DANS DBF Library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 99.7%
  • HTML 0.3%