This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
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

Win a copy of Head First Android this week in the Android forum!
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: 32319

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]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, 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)
It's not a secret anymore!