wood burning stoves*
The moose likes Java in General and the fly likes serverless database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "serverless database" Watch "serverless database" New topic
Author

serverless database

biswajit goswami
Ranch Hand

Joined: Dec 05, 2005
Posts: 35
can anyone throw light on serverless database sort of how applications like windows media player uses in its media library...for a standalone database based app that can be run anywhere without need to configure any database server or app
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
One way to have a serverless database is to store data in a textfile.


My blood is tested +ve for Java.
Srinivasa Raghavan
Ranch Hand

Joined: Sep 28, 2004
Posts: 1228
XML related stuffs can also be used.


Thanks & regards, Srini
MCP, SCJP-1.4, NCFM (Financial Markets), Oracle 9i - SQL ( 1Z0-007 ), ITIL Certified
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
Originally posted by Srinivasa Raghavan:
XML related stuffs can also be used.


Ya, better to use XML.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8877
    
    8

Originally posted by Chetan Parekh:

Ya, better to use XML.


You forgot the phrase: Depending on your requirements
XML is intended to make data transfer between different systems easier. If you are just persisting some data for your own use you are wasting a lot of time and energy converting data from a form your app can use into XML and back again.
Depending on our friend's requirements, he may be well served by Using Java Object Serialization Instead of a Database. Unlike XML, his code doesn't have to deal with the particulars of HOW the data is stored, just load a config object from file. Quick, simple, effective.
If he has more complex needs, there's lightweight embedded databases like the popular Berkeley Database or even full-scale SQL databases like Apache Derby that can run within the same JVM as an application.
[ February 17, 2006: Message edited by: Joe Ess ]

"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by Chetan Parekh:

Ya, better to use XML.


Depends on the data. XML is good for hierarchical data. For more simple, plain data, a properties file or some proprietary text format might be more appropriate.

And then there are database that can run in an embedded mode, such as http://www.hsqldb.org/.


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
Joe Ess and Ilja Preuss you both are right.

Diswajit Goswami, can you just tell more about your application?
biswajit goswami
Ranch Hand

Joined: Dec 05, 2005
Posts: 35
Thanx for the replies.....so,does windows media plyr and sorts using flat files as database??may be.........i shall be glad if somebody could illustrate using flat files and xml files to perform database operations(i have so long done with database servers basically).........the goal is to have a standalone database intensive app which can be run anywhere by its executable jar .Any good link,code snippets,book??thanx in advance
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
Originally posted by biswajit goswami:
Any good link,code snippets


If you are lucky, you will get it here.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
If you really want to execute complicted SQL queries on the data, I'd go with an embedded database.

An OO database might be interesting to look at, too. Haven't used one myself yet, but a friend of mine has had very good experiences using one for small to medium sized data (such as I would expect a media player having to handle).
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
This open source project lets you apply SQL like statements to collections of Java objects.
The Sleepycat implementation of Berkley DB is supposed to support the XQuery language for embedded databases.
Bill
saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
Yes, u need need to use embedded HSQLDB server itz very compact..
and u can get it for free...
and free licenece is provided by them...
u can use it with ur application..
just google it man for HSQL DB

regards
cinux


A = HARDWORK B = LUCK/FATE If C=(A+B) then C=SUCCESSFUL IN LIFE else C=FAILURE IN LIFE
SCJP 1.4
Lukas Eder
Ranch Hand

Joined: Jul 22, 2013
Posts: 41
    
    4

Any of these three popular Java databases can be embedded in your application:

  • Derby
  • H2
  • HSQLDB


  • When Java and SQL work together, great software can evolve. That's why I have created jOOQ. Follow me on blog.jooq.org
     
    wood burning stoves
     
    subject: serverless database