0

I need to take in an input file in DBF format (I believe it is made via Foxpro) and read the records sequentially for processing.

Is there any way to do this in Java without use of external libraries?

Thanks.

(I'm just avoiding use of external libraries as much as possible because I will still need to obtain approval for it)

heisenbergman
  • 1,459
  • 4
  • 16
  • 33
  • By external libraries do you mean "native code libraries"? Reading Foxpro in pure Java is probably hard already, but if you mean "only JDK, no JAR file" then: no. – Thilo Jul 18 '13 at 09:39
  • Yeah that's what I mean... ...well then if that is an unrefutable, irrevocable NO... What could you suggest to use (external JAR/library) for processing a DBF file in Java? – heisenbergman Jul 18 '13 at 09:45
  • I don't know if this is the same DBF, but: http://stackoverflow.com/questions/2277523/read-write-xbase-dbase-3-5-dbf-files – Thilo Jul 18 '13 at 09:47

2 Answers2

4

Try JDBF: https://github.com/iryndin/jdbf

I am the project owner of JDBF.

If you find any bugs don't hesitate to send me bug reports, will fix it.

iryndin
  • 530
  • 1
  • 5
  • 11
3

The original DBF format is pretty simple. So if you only have to read .dbf files, it's not that hard, see Wikipedia. If you have read the header, you should be able to "jump" directly to the records.

There are plenty of resources on the web; for example on SO:

  • As for the header, have a look at this
  • As for reading the records, look here

So I would just give it a try to read it using java.io.RandomAccessFile

Community
  • 1
  • 1
Beryllium
  • 12,808
  • 10
  • 56
  • 86