1

I would like to know how to set autocommit to false for the Microsoft dBase driver, which use is for example presented in https://stackoverflow.com/a/8079987/613495

Using connection.setAutoCommit(false) method throws java.sql.SQLException: [Microsoft][ODBC dBase Driver]Optional feature not implemented

If such functionality is in fact not supported, then do you know of any other free driver for DBFs?

Community
  • 1
  • 1
Boro
  • 7,913
  • 4
  • 43
  • 85

2 Answers2

1

The underlying driver does not support transactions. Unfortunately it appears that the only reasonable option is HXTT.

reference Read/Write xBASE (DBASE 3-5 /DBF) files

Community
  • 1
  • 1
wort
  • 136
  • 4
  • Thanks for this info (+1). I still wonder if there is some other free alternatives available. As in my project I cannot use a commercial option. – Boro Feb 14 '12 at 10:14
1

I was using KObjects Jdbcwrapper project to access DBF files when I needed to fix OpenOffice bibliography (you can look at my source code here).

It was doing its job for my reading purposes well (just one minor encoding related issue that I needed to fix), however I didn't use it for writing.

I can see that writing is supposedly supported too - at least there is some code in DbaseTable.java, so chances are it is going to work for you.

It's LGPL.

Oleg Mikheev
  • 17,186
  • 14
  • 73
  • 95
  • Thanks. I would still prefer a driver. Since I have re-coded my program when it got big from the [DANS DBF library](http://dans-dbf-lib.sourceforge.net/) and it is using the aforementioned driver and I can easily execute SQL queries. I also didn't see how would this wrapper support transactions? Thanks anyway (+1). – Boro Feb 21 '12 at 09:16
  • DANS library was not available back in 2007 when I was coding my fix :) and most probably jdbcwrapper doesn't support transactions :( – Oleg Mikheev Feb 21 '12 at 09:48