0

I have a BerkeleyDB database with a .tld extension (eBay Turbolister file). Linux command 'file' confirms this is a BerkeleyDB database.

I am following the tutorial at http://download.oracle.com/docs/cd/E17277_02/html/collections/tutorial/opendbenvironment.html.

The com.sleepycat.je.Environment constructor accepts a directory, not a file. Reading a little, I found this directory is supposed to contain the database file and other files such as logs.

My question is: how do I specify the filename of the database to open - or does the database file need to have a specific filename? Second, does the file need to be in its own dir?


Some complimentary information to the answer below I found after browsing the API JavaDoc:

com.sleepycat.je.Environment has the following method that accepts a filename:

public Database openDatabase(Transaction txn,
                             String databaseName,
                             DatabaseConfig dbConfig)

1 Answer 1

2

The tutorial you mentioned is for the Java Edition of Berkeley DB. Are you sure that your database file is created with the Java Edition?

The native version of Berkeley DB has also a Java binding but uses the native libraries. Maybe this fits better?

Included in the native version are command line tools like db_stat and db_verify. You can use these tools to check your file without the need to write a program.

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

4 Comments

Thanks for clearing up the confusion.! If it is indeed a BDB file, I will have to write a Java program that migrates it to a Hibernate SQL SB, so that it can be used in a web app. I will look-up the tools you mentioned and the Java binding.
db_verify Desktop/panag_3.tld Verification of Desktop/panag_3.tld succeeded. So now I will have to look up the Java binding.
The Java bindings for the Berkeley DB library offer a means to open an Environment given a File, but it still designates the containing directory. download.oracle.com/docs/cd/E17275_01/html/java/com/sleepycat/… The Environment#openDatabase() call does accept a file name, though it's not clear if it needs to be contained within the Environment's directory.
Thanks, I just found this independently!

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.