can i use bdb(berkeley db) file created by c implementation (python bsddb) by oracle berkeley db java edition?

StackOverflow https://stackoverflow.com/questions/195657

Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

Note that there are three different products

  1. Berkeley DB -- the C implementation
  2. Berkeley DB Java Edition
  3. 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".

I haven't researched the definite answer, but I have the same experience. A database created with pythons bdb, and also accessible with the cli utils, is not detected at all by the Java API. The reverse was also true.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top