Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / February 2004

Tip: Looking for answers? Try searching our database.

Random Access Database File

Thread view: 
J. Passing - 28 Jan 2004 09:48 GMT
Hi all,

ia am searching for a database that enables me to store variable length
binary records in a single file and have random access to them. The
records should be referenced by a key and, if possible, should be
organized in a hierarchie, just like a file system. I do not need any
sophisticated searching techniques in this database.

Does anyone know a good implementation of such a database?

Thanks,
  Jo
Erwin Moller - 29 Jan 2004 08:44 GMT
> Hi all,
>
[quoted text clipped - 8 lines]
> Thanks,
>    Jo

Hi Jo,

What you want sounds simple enough to do by hand and basic file-io.
Maybe just a single file with three values per line?
Just some CSV-like structure will do.
ID,PATH,BINARYDUMP<newline>

If you make sure your binarydump is encoded some safe way (in this case: no
raw comma's and no newlines) you are ready to go.

Just make a few routines for lookup for ID (SELECT-functionality) and
Insertion of a new record (INSERT-functionality) and DELETE.
The only thing you need is basic file-io to delete a line, or lookup a line.

It will not have great performance, but you have just one simple file.

I guess in most situations I would just prefer a normal database though, but
I don't know your requirements.

Hope this helps,
Regards,
Erwin
Manuel J. Goyenechea - 30 Jan 2004 18:47 GMT
Hello,

Have you looked at Servertec Persistent Object Store, www.servertec.com

Manny

> Hi all,
>
[quoted text clipped - 8 lines]
> Thanks,
>    Jo
NOBODY - 02 Feb 2004 03:14 GMT
"J. Passing" <johannes.passing@gmx.net> wrote in news:bv80cl$r4t$1
@zeppelin.rz.uni-potsdam.de:

> Hi all,
>
[quoted text clipped - 8 lines]
> Thanks,
>    Jo

You want a cache, a hashmap that swaps to disk or a standard jcache
implementation?

Anyway, you should probably do this:

-write a serializable record class
-write a diskelement class that hold the "long" diskpointer.
-write a diskstore that appends/deletes/manages diskblocks in a file.

All that in a week max.

Or just search for "EHCache".


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.