jdbf

jdbf - a fork of iryndin's Java library to read/write DBF files

Лицензия

Лицензия

Группа

Группа

com.github.spyhunter99
Идентификатор

Идентификатор

jdbf
Последняя версия

Последняя версия

2.2.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

jdbf
jdbf - a fork of iryndin's Java library to read/write DBF files
Ссылка на сайт

Ссылка на сайт

http://github.com/iryndin/jdbf
Организация-разработчик

Организация-разработчик

Github
Система контроля версий

Система контроля версий

https://github.com/spyhunter99/jdbf

Скачать jdbf

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.spyhunter99/jdbf/ -->
<dependency>
    <groupId>com.github.spyhunter99</groupId>
    <artifactId>jdbf</artifactId>
    <version>2.2.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.spyhunter99/jdbf/
implementation 'com.github.spyhunter99:jdbf:2.2.1'
// https://jarcasting.com/artifacts/com.github.spyhunter99/jdbf/
implementation ("com.github.spyhunter99:jdbf:2.2.1")
'com.github.spyhunter99:jdbf:jar:2.2.1'
<dependency org="com.github.spyhunter99" name="jdbf" rev="2.2.1">
  <artifact name="jdbf" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.spyhunter99', module='jdbf', version='2.2.1')
)
libraryDependencies += "com.github.spyhunter99" % "jdbf" % "2.2.1"
[com.github.spyhunter99/jdbf "2.2.1"]

Зависимости

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12

Модули Проекта

Данный проект не имеет модулей.

jdbf

Join the chat at https://gitter.im/iryndin/jdbf

JDBF builds at https://travis-ci.org/iryndin/jdbf

Java utility to read/write DBF files

Version 2.2.1 May 3, 2020

Fix issue PR1 - incorrect header when writing.

Version 2.2.0 Sept 29, 2019

(This fork) publish to central

Version 2.1.0

Fix issue #5 - don't load DBF and MEMO files into memory when reading it (thanks to Eugene Michuk for noticing this!)

Fix issue #9 - don't define some DBF file types correctly (thanks to l1feh4ck3r!!)

Version 2.0.2

Fix issue #7 - add DbfRecord.isDeleted() method that checks if record is deleted.

Version 2.0.1

Fix issue #3 - read the last record two times for "FoxBASE+/Dbase III plus" files

Fix issue #4 - incorrect parsing of update date in DBF header for "FoxBASE+/Dbase III plus" files

Version 2.0

Add ability to read MEMO files (tested with Visual FoxPro DBFs)

Dependency Status

User Guide

Read DBF file

Piece of code that reads file from classpath. Single DBF record is represented here as a Map.

See TestDbfReader.java

    public void readDBF() throws IOException, ParseException {
        Charset stringCharset = Charset.forName("Cp866");

        InputStream dbf = getClass().getClassLoader().getResourceAsStream("data1/gds_im.dbf");

        DbfRecord rec;
        try (DbfReader reader = new DbfReader(dbf)) {
            DbfMetadata meta = reader.getMetadata();

            System.out.println("Read DBF Metadata: " + meta);
            while ((rec = reader.read()) != null) {
                rec.setStringCharset(stringCharset);
                System.out.println("Record #" + rec.getRecordNumber() + ": " + rec.toMap());
            }
        }
    }

Read DBF file with MEMO fields

Piece of code that reads DBF and MEMO fields.

See TestMemo.java

    public void test1() {
        Charset stringCharset = Charset.forName("cp1252");

        InputStream dbf = getClass().getClassLoader().getResourceAsStream("memo1/texto.dbf");
        InputStream memo = getClass().getClassLoader().getResourceAsStream("memo1/texto.fpt");

        try (DbfReader reader = new DbfReader(dbf, memo)) {
            DbfMetadata meta = reader.getMetadata();
            System.out.println("Read DBF Metadata: " + meta);

            DbfRecord rec;
            while ((rec = reader.read()) != null) {
                rec.setStringCharset(stringCharset);

                System.out.println("TEXVER: " + rec.getString("TEXVER"));
                // this reads MEMO field
                System.out.println("TEXTEX: " + rec.getMemoAsString("TEXTEX"));
                System.out.println("TEXDAT: " + rec.getDate("TEXDAT"));
                System.out.println("TEXSTA: " + rec.getString("TEXSTA"));
                System.out.println("TEXCAM: " + rec.getString("TEXCAM"));
                System.out.println("++++++++++++++++++++++++++++++++++");
            }

        } catch (IOException e) {
            //e.printStackTrace();
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }

Версии библиотеки

Версия
2.2.1
2.2.0