File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Access Berkeley DB Files (DBM) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Access Berkeley DB Files (DBM)" Watch "Access Berkeley DB Files (DBM)" New topic

Access Berkeley DB Files (DBM)

Andrew Patzer
Ranch Hand

Joined: Jul 11, 2002
Posts: 30
Can someone help point me to a very simple way to access Berkeley DB files? We have a set of DBM files that I'd like to use in a Java program. I've identified a few possibilities, none of which I'm that crazy about. Is there a JDBC driver available? Is there a Java API to walk through the file?

It appears that I can build a set of Java classes from the Berkeley DB source code that may be of use, but I'd rather find an easier solution.


Andrew Patzer

Andrew Patzer<br /> <br />Author of: <br /> <br /><a href="" target="_blank" rel="nofollow">JSP Examples and Best Practices</a><br /> <br /><a href="" target="_blank" rel="nofollow">Foundations of JSP Design Patterns</a>
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33130

Unfortunately, there isn't a JDBC driver available.

This article explains why in detail. The short answer is:
If you're wondering why there isn't a JDBC driver, the short answer is that Berkeley DB isn't a relational database.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Andrew Patzer
Ranch Hand

Joined: Jul 11, 2002
Posts: 30
Thanks. I figured I didn't have many options. Rather than write a JNI wrapper, I think I'll just have to write a Perl script for this function until we can replace the DBM files with something else.
I agree. Here's the link:
subject: Access Berkeley DB Files (DBM)
jQuery in Action, 3rd edition