IT-     LGPL
12.01.2014

4.81.07


LGPL page
/ /

DbfEngine Java API

DbfEngine - A Java API to read, write xBase(DBASE, Foxpro dbf files).
Also API allows read memory files (.mem) of Foxpro and may be Clipper. Samples for both operations you may see at DbfEngine javadoc.

This API is pure lightweight library without memory consumption and any third party libraries. There are no java loggers and modern mappers.
This DBF Java API is intended as engine for data exchange purposes.

Features

Engine is very small and fast.
API for reading is made as iterator, API for writing is made in manner as JDBC statement. It is allows to write compact Java code. See code samples below.

Limitations

This version was tested under MS Foxpro 2.6 without memo field support.

Requirements

DbfEngine requires JDK 1.5 or higher.

Licensing

DbfEngine is issued on under the GNU Lesser General Public License. For further information click here.

Download

You may download DbfEngine 1.05 (2014-JAN-20) version binary code here , source code here and all bundle here
Latest online Javadoc you may see here, version history you may see here.

Donation

If this library was useful for your project please publish the link to this page.
If you have any questions or suggestions please do not hesitate to ask me by ask@smart-flex.ru.
DbfEngine - Java API , xBase(DBASE, Foxpro) . API .mem Foxpro Clipper'. .dbf .mem DbfEngine javadoc.

API . . .



API .
API , API jdbc Statement. . .



dbf MS Foxpro 2.6 memo.



DbfEngine JDK 1.5 .



API LGPL.



1.05 (2014-01-20) , Java , javadoc
Javadoc API , .
Code sample for reading and writing below: dbf

public class Fp26Reader {

 

private static void testRead() {

DbfIterator dbfIterator = DbfEngine.getReader(

Fp26Reader.class.getResourceAsStream("FP_26_SAMPLE.DBF"), null);

while (dbfIterator.hasMoreRecords()) {

DbfRecord dbfRecord = dbfIterator.nextRecord();

String string = dbfRecord.getString("string");

float sumFloat = dbfRecord.getFloat("sum_f");

BigDecimal sumNumeric = dbfRecord.getBigDecimal("sum_n");

boolean bool = dbfRecord.getBoolean("bool_val");

Date date = dbfRecord.getDate("date_val");

System.out.println(string + " " + sumFloat + " " + sumNumeric + " "

+ bool + " " + date);

}

}

 

public static void main(String[] args) {

Fp26Reader.testRead();

}

 

}

 

public class Fp26Writer {

 

private static void testWrite() {

DbfAppender dbfAppender = DbfEngine.getWriter("WRT_PERSON.DBF", DbfCodePages.Cp866);

DbfColumn dc01 = new DbfColumn("magic", DbfColumnTypes.Logical, 0, 0);

DbfColumn dc02 = new DbfColumn("actor", DbfColumnTypes.Character, 60, 0);

DbfColumn dc03 = new DbfColumn("currdate", DbfColumnTypes.Date, 0, 0);

DbfColumn dc04 = new DbfColumn("hit", DbfColumnTypes.Numeric, 10, 2);

DbfColumn dc05 = new DbfColumn("forever", DbfColumnTypes.Logical, 0, 0);

dbfAppender.defineColumns(dc01,dc02, dc03, dc04, dc05);

DbfStatement statement = dbfAppender.getStatement();

statement.setString("actor", "Chuck Norris");

statement.setDate("currdate", new Date());

statement.setBigDecimal("hit", new BigDecimal("500.5"));

statement.insertStatement();

 

statement.setBoolean("magic", Boolean.TRUE);

statement.setString("actor", "Bruce Lee");

statement.setBigDecimal("hit", new BigDecimal("1000.10"));

statement.setBoolean("forever", Boolean.TRUE);

statement.insertStatement();

dbfAppender.writeDbfAndClose();

}

public static void main(String[] args) {

Fp26Writer.testWrite();

}

 

}