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 / December 2005

Tip: Looking for answers? Try searching our database.

J2EE: Storing hierarchical data

Thread view: 
Florian Lindner - 15 Dec 2005 20:07 GMT
Hello,
I'm searching for the best concept of how to use and save hierarchical data
in a J2EE server.
I have a structure like a PC file system with meta data. There a folders and
files of different types. Every object have data like permissions, date and
author. And they have type-specific data fields like resolution (of an image
type) or location (of an meeting type) or ingredients (of an recipe type).
What is the best way to store that kind of data in an J2EE web application?
What database is recommendable? What concepts of persistance? Or not using
managed persistance and do it manually?

Thanks for all ideas!

Florian
Mladen Adamovic - 16 Dec 2005 09:01 GMT
> I'm searching for the best concept of how to use and save hierarchical data
> in a J2EE server.

To me it looks like XML file structure, so I would consider
using XML database (probably native one like Xindice).

You can find a list of XML database at
http://www.rpbourret.com/xml/XMLAndDatabases.htm
or somewhere around ;)

Signature

Mladen Adamovic
http://home.blic.net/adamm

Florian Lindner - 16 Dec 2005 13:28 GMT
>> I'm searching for the best concept of how to use and save hierarchical
>> data in a J2EE server.
[quoted text clipped - 5 lines]
> http://www.rpbourret.com/xml/XMLAndDatabases.htm
> or somewhere around ;)

Hi,
Xindice is optimized for storing a large number of smaller XML documents.
AFAIK these document itself are not organized hierarchily. Please correct if
I am wrong.

I'll take a look at the list you provided. Thanks!

Florian
Mladen Adamovic - 16 Dec 2005 17:06 GMT
> Xindice is optimized for storing a large number of smaller XML documents.
> AFAIK these document itself are not organized hierarchily. Please correct if
> I am wrong.

You have right. Xindice isn't good for large documents. I've heard that
Berkeley DB XML is the best choice nowadays for the large XML documents.
That told me the guy whom I think is the real expert in this field.

Software AG's Tamino is supposed to be the best commercial product which
support large files.

If you don't find anything worth in above products you might look at the
my project - dummy XML:DB wrapper around MySQL at address
http://sourceforge.net/projects/myxmldb

Signature

Mladen Adamovic
http://home.blic.net/adamm

Jon Martin Solaas - 28 Dec 2005 11:24 GMT
> Hello,
> I'm searching for the best concept of how to use and save hierarchical data
[quoted text clipped - 10 lines]
>
> Florian

The most straight forward way would be to store data in a normal sql
database.

One table for the hierarchy

create table dir
(
dir_id number,
parent_dir_id  number,
dir_name varchar2(255),
dir_type number,
dir_metadata varchar2(255)
)

create table file
(
file_id number,
dir_dir_id number,
file_type number,
file_metadata varchar2(255)
)

Then you have a hierarcy defined in the table dir, and each file belongs
in exactly one dir (unless you make a N:N relationship ofcourse). You
could also store information about type and metadata in separate tables
or whatever suits your needs.

Next would be to select a persistence technology. This would work with
most known technologies and the easiest would probably be to use the
same as you use for other relational data in your application. Straight
jdbc, Hibernate, CMP ... it's your choice. CMP has some features to
manage relations automatically for you, and I'm sure Hibernate has some
features to help you out with the relational/hierarchical stuff here as
well.

This method would give you all the pros and cons that sql databases
always do, transactions and so on. I don't know how you intend to use
your hierarcy so it's impossible to tell if this is useful for you.

One alternative for storing hierarchical data that sometimes comes up is
using Prevayler (you'll find it at google), which is sort of a very fast
in-memory hierarchical database. I've never tried it, but it's
supposedly very fast, and has different characteristics from a normal,
relational dbms.


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.