my dog learned polymorphism*
The moose likes Java in General and the fly likes Storage and retrieval of data - best option? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Storage and retrieval of data - best option?" Watch "Storage and retrieval of data - best option?" New topic
Author

Storage and retrieval of data - best option?

joseph corner
Ranch Hand

Joined: Feb 20, 2004
Posts: 50
Hi,
I am writing a java server-side application which needs to store info about educational courses, and users in those courses.

When retrieving data, I need to ask:
- does this course already have an entry?
- if so, which users are listed there?

When storing data, I need to ask:
- does this course already have an entry? If so, append user entry. If not, create course entry, append user entry.

It's not convenient to use a database for this. So my question is: should I create an xml file of users for each course, then check for the existence of the course using file.exists()? Or should I put all courses and users in one xml file?
Or some other approach - perhaps not using xml?

I'm interested in terms of speed and overhead.

Thanks!
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


It's not convenient to use a database for this.

I'm curious - why not?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
joseph corner
Ranch Hand

Joined: Feb 20, 2004
Posts: 50
Long story.
- The application is a plugin in a larger web app which is hosted remotely. Setting up db connections to it is complicated.
- I want the plugin to be self-contained and portable.
I guess I could use one of those embedded databases - Berkeley? That seems a bit over the top in this case though.
[ March 19, 2007: Message edited by: joseph corner ]
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2477
    
    7

I guess I could use one of those embedded databases
HSQL Database Engine?
Not difficult to set up on a hosting server (does not have to run as a service), portable, contained in one jar.

You can run it as an integral part of your plug-in:
In-Process (Standalone) Mode
This mode runs the database engine as part of your application program in the same Java Virtual Machine
Regards, Jan


OCUP UML fundamental and ITIL foundation
youtube channel
joseph corner
Ranch Hand

Joined: Feb 20, 2004
Posts: 50
Thanks, I'll take a look at that. Do you know if HSQLDB uses up a lot of resources when used in a server-side application in this way? (Memory?)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Storage and retrieval of data - best option?
 
Similar Threads
Saving lots of data to file
Converting XML and Builder pattern
Input/Output
URLyBird 1.3.2 : Configuration Doubt
Database .db file question