Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java equivalents to dbm/gdbm libraries?



On Thursday, November 28, 2002, at 01:50 am, kmmcdonald wrote:

I'm working on a project for which I want to use a Java library which lets me treat an on-disk file as a very large HashMap--basically, the equivalent of what dbm/gdbm can do in C, as typified by Python's 'pickle' module. There is already quite a nice BSD license Java library call JDBM which does this; it allows either keys or data to be arbitrary objects, and seems to be quite stable (in spite of its version number being 0.12). However, before I use that, I thought I would check to see if anyone could recommend other similar libraries which might be more advanced or use more recent technology. (JDBM, for example, dates from the era when Enumerators rather than Iterators were the way to go :-) ).

This sort of functionality can be incredibly useful, and I'm very surprised Sun hasn't included anything like it in the standard distribution.


They have.

If you don't mind the whole file being read into memory the java.util.HashMap is serialisable so you could use that. If you want the file to be human readable/editable then java.util.Properties is another option. If you want to treat a text file as a database have a look at the text JDBC driver.

Thanks,
Ken McDonald
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.

References: 
 >Java equivalents to dbm/gdbm libraries? (From: kmmcdonald <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.