Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror

Comment Another option: db4objects (Score 1) 139

Another option for embeddable databases: db4objects (http://www.db4o.com/).

The runtime is a JAR that's about 300KB in size, with about a 1 meg memory footprint.

Companies like BMW and Bosch have chosen it to drive their automobiles and robots respectively.

The best way to get a feel for db4objects is to look at how simple the code is you get to write. For example:

To store a Pilot object:

ObjectContainer db=Db4o.openFile(Util.YAPFILENAME);
try {
Pilot pilot1=new Pilot("Michael Schumacher",100);
db.set(pilot1);
}
finally {
db.close();
}
To retrieve all pilots:
// Put this in a try-finally block like above
ObjectSet result=db.get(Pilot.class);
while (result.hasNext())
System.out.println(result.next ());
To retrieve a pilot by name:
// (use query-by-example)
Pilot proto=new Pilot("Michael Schumacher",0);
ObjectSet result=db.get(proto);
if (result.hasNext()) Pilot firstMatch = (Pilot) result.next();
To update a pilot:
ObjectSet result=db.get(new Pilot("Michael Schumacher",0));
Pilot found=(Pilot)result.next();
found.addPoints(11);
db.set(found);
System.out.println("Added 11 points for "+found);
There's lots more including embedded or client/server operation, transactions, partial activation of large object graphs, and more.

Oh, and db4objects works with plain old Java objects. You don't have to implement interfaces, inherit from a particular class, or anything like that.

If you're looking for the simplest, light-weight, zero-administration, embeddable database you could imagine, in my experience, db4objects is it.

(I liked it so much that as of 1.5 weeks ago I started working for the company.)

Best regards,

Dave Orme
--
db4objects senior engineer
Eclipse Visual Editor Project leader (http://www.eclipse.org/vep)
XSWT project leader (http://xswt.sourceforge.net/)

Slashdot Top Deals

Space is to place as eternity is to time. -- Joseph Joubert

Working...