I have a berkeley db file (*.bdb) which is created by the C implementation(python bsddb module). Is it possible to read this file by a pure java implementation of Berkeley Db? I tried to read it using berkeley db java edition (je) but could not. je throws out an exception saying that it could not detect the berkeley database. Are berkeley db files not inter operable across different implementations? If so, why?
3 Answers
No.
According to the Berkeley DB Java Edition FAQ, Berkeley DB and Berkeley DB Java Edition are not compatible with one another because they have a different file layout structure.
Comments
Note that there are three different products
- Berkeley DB -- the C implementation
- Berkeley DB Java Edition
- Berkeley DB XML
see, Wikipedia
It is true that the "Berkeley DB" and "Berkeley DB Java Edition" have different (i.e. incompatible) file format. However, the "Berkeley DB" product does provide a Java API via JNI. So it is possible to access data file written by the C implementation from Java, but not with the "Berkeley DB Java Edition".