0

I need to read BerkeleyDB files from Java.

Oracle has an official Java Edition of BerkeleyDB, but it seems that this uses its own, incompatible binary file format.

What do I do?

1

2 Answers 2

1

According to the Wikipedia page, there are Java bindings for classic Berkeley DB, but they require use of JNI and a native library. Here's a link to the Sleepycat Berkeley DB - Java API documentation.

Sign up to request clarification or add additional context in comments.

Comments

0

Berkeley DB can actually store data in 2 different formats, depending on whether you elect to use the SQL API or not. The SQL API is a recent addition, Berkeley DB has historically been a key/value database.

It is true that you need to build the native library and use JNI, but this is to be expected if you want to access files created by a native library. Fortunately, the build process is very simple.

If you are building under Windows, please refer to the installation guide.

For Linux or other *NIX, after you have untarred the file go to the build_unix directory and do one of the following:

  • If you are using the (standard) key/value interface:

../dist/configure --enable-java --prefix=/usr/local/db

make install

  • If you are using the SQL API:

../dist/configure --enable-sql --enable-jdbc --prefix=/usr/local/db

make install

(Obviously you can replace --prefix with the install location of your choice)

For more information see the docs page.

Hope that helps, good luck with your project.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.