Java and object databases

This example uses the ODMG Java Binding and the ODMG Object Query Language (OQL). Other query languages for object databases would be similar. Notice that all the code is Java, with the exception of the query string. You will not find a database sub-language in this example. The part in blue relates to the animation of transparent persistence (new window). More information on the ODMG specification (new window). Note that the same code would used for object-relational mapping products (new window). Transparent persistent interfaces work with both object database or object-relational mapping products.

import org.odmg.*;
import java.util.Collection;
Implementation impl = new com.vendor.odmg.Implementation();
Database db = impl.newDatabase();
Transaction txn = impl.newTransaction();
try {
    db.open("addressDB", Database.OPEN_READ_WRITE);
    txn.begin();
    // perform query
    OQLQuery query = new OQLQuery(
       "select x from Person x where x.name = \"Doug Barry\"");
    Collection result = (Collection) query.execute();
    Iterator iter = result.iterator();
    // iterate over the results
    while ( iter.hasNext() )
    {
        Person person = (Person) iter.next();
        // do some addition processing on the person (not shown)
        // now traverse to the address object and update its value
        person.address.street = "13504 4th Avenue South";
    }
    txn.commit();
    db.close();
}
//exception handling would go here ...

 

 

Web Services and Service-Oriented Architectures
Online articles>
Consulting
Mentoring
Speaking
Suggested programs
Stencils for the Savvy Manager's Guide
Links
Mail list
Privacy policy
Sitemap
Contact
Web Services articles
XML standards and vocabularies
Application server articles
Database concepts and standards
Object database articles>
Relational database articles
Object-relational mapping articles
XML database articles
XML middleware articles
Article Sponsorship
Reprint policy
Object-oriented database management system (OODBMS) definition>
When an object database should be used
ODBMS FAQ
Caching for object database management systems
Architectures that use object database products
Everyday uses of object databases
ODBMS myths
Object database problems?
Article suggestions
Transparent persistence
Lack of impedance mismatch
How to access data in an object database>
Navigation with an object database
Java and object databases>
JDO and object databases
C++ and object databases

Related recent articles from Google News


SYS-CON Media

I am a big fan of Flex...but it is not a tool that every ...
SYS-CON Media, NJ - May 15, 2008
NETDJ News Desk db4objects has announced that its db4o object database is now optimized for Microsoft's LINQ. With the new support, developers can choose an ...

db4o First Open Source Object-Oriented Database in the Industry to ...
Business Wire (press release), CA - May 5, 2008
(BUSINESS WIRE)--db4objects (www.db4o.com), creator of the leading open source object database, has announced that its db4o object database is now optimized ...

Uncommon Java Bugs
SYS-CON Media, NJ - May 12, 2008
NETDJ News Desk db4objects has announced that its db4o object database is now optimized for Microsoft's LINQ. With the new support, developers can choose an ...

db4o Open Source Object-Oriented Database Supports LINQ
SYS-CON Media, NJ - May 12, 2008
db4objects (www.db4o.com) has announced that its db4o object database is now optimized for Microsoft?s LINQ. With the new support, developers can choose an ...

db4o First Open Source Object-Oriented Database in the Industry to ...
Centre Daily Times, PA - May 5, 2008
db4objects (www.db4o.com), creator of the leading open source object database, has announced that its db4o object database is now optimized for Microsoft's ...

More related news: java "object database" OR "object-oriented database" - Google News

Related books at Amazon.com


Succeeding with Object Databases: A Practical Look at Today's Implementations with Java and XML
by Akmal B. Chaudhri, Roberto Zicari
Publisher: John Wiley & Sons
Publication Date: September 2000

Implementation and Integration of the Object Transaction Service of Corba to a Java Application Database Program
Editorial Review: This is a NAVAL POSTGRADUATE SCHOOL MONTEREY CA report procured by the Pentagon and made available for public release. It has been reproduced in the best form available to the Pentagon. It is not spiral-bound, but rather assembled with Velobinding in a soft, white linen cover. The Storming Media report number is A156873. The abstract provided by the Pentagon follows: In examin...

Visual Cafe' for Java Explorer: Database Development Edition: Maximize Your Object-Oriented Programming Skills to Create Database Applets and Applications Using Java
by William B. Brogden, Jeffrey A. Louie, Ed Tittel
Average Customer Review: 4 stars based on 9 reviews.
Customer Review: I echo the other reviewer's frustration that few publishers mention the version of the tool their books cover in the hopes that developers will buy their books even when they are obsolete. This is predatory and misleading, and I hope that developers will boycott publishers who evince this policy. For version 2.0, the book is very rea...

Effective Use of Java Data Objects in Developing Database Applications; Advantages and Disadvantages
Editorial Review: This is a NAVAL POSTGRADUATE SCHOOL MONTEREY CA report procured by the Pentagon and made available for public release. It has been reproduced in the best form available to the Pentagon. It is not spiral-bound, but rather assembled with Velobinding in a soft, white linen cover. The Storming Media report number is A629424. The abstract provided by the Pentagon follows: Currently...

More related books: Search Amazon.com for java object database

 

Copyright © 2000-2008 Barry & Associates, Inc. All Rights Reserved.
You can use this material for your work or classes. Click here for our reprint policy.
www.service-architecture.com

 

 Information on becoming a sponsor

 

 

Google

 

Barry & Associates, Inc.