ObjectDB - Object Database for Java Home | About Us | Customers | Free Download | Purchase
 
  <Back to Main Menu>   
 
 
JDO Directory Demo
Demo Home

Source Code
directory.Utilities
directory.pc.*
directory.step1.*
directory.step2.*
directory.step3.*
directory.step4.*

J2SDK Instructions
J2SDK on Windows
J2SDK on Unix

IDE Instructions
Borland JBuilder
IBM Eclipse
NetBeans / Forte /
Sun One Studio
JCreator
 



 

ObjectDB for Java/JDO Demo
Java 2 SDK for Unix

     JDO Directory

The JDO Directory demo has been tested with Java 2 SDK 1.4.1,
Java 2 SDK can be downloaded from: http://java.sun.com/j2se/downloads.html .

Set the Environment

Open a command prompt and set the current directory to be the demo directory. For example:

% cd ~/objectdb/samples/jdo-directory


Set the CLASSPATH to include the current directory and ObjectDB / JDO jar files:

On csh:

% setenv CLASSPATH .:../lib/jdo.jar:../lib/odbfe.jar

On sh / bash:

% CLASSPATH=.:../lib/jdo.jar:../lib/odbfe.jar

Use odbse.jar or odbee.jar for other ObjectDB editions.

Compile the Demo

Use the javac compiler to compile all the demo source files:

% javac directory/*.java

% javac directory/pc/*.java
% javac directory/step1/*.java
% javac directory/step2/*.java
% javac directory/step3/*.java
% javac directory/step4/*.java

If javac does not work, you may need to write the full path to javac.

Run the Demo

Step 1
This step creates a new ObjectDB database and stores an initial object graph using JDO.

% java directory.step1.eMain

The expected output is:

[ObjectDB Enhancer] 4 new persistence capable classes have been enhanced.
Database is ready now...

The [ObjectDB Enhancer] message, indicating "on the fly" JDO enhancement of four persistence capable classes, is not shown if these classes are already enhanced.

Step 2
This step uses JDO to create, update and delete an object:

% java directory.step2.eMain

The expected output is:

Operations have been completed...

Eventualy, the database content remains the same after these operations.

Step 3
This step retrieves objects from the database using JDO extents and queries, without modifying the database.

% java directory.step3.eMain

The expected output:

All directory.pc.Category instances:
  JDO Directory
  Consulting & Training
  Books
All directory.pc.Item instances:
  Object Identity
  Ogilvie Partners
  Smart Soft
  Robin Roos, Java Data Objects, Addison-Wesley 2002
  David Jordan and Craig Russell, Java Data Objects, O'Reilly & Associates,
Inc. 2003
  David Ezzio, Using and Understanding Java Data Objects, Apress 2003
  K. McCammon, H. Bobzin, S. Tyagi and M. Vorburger, Core JDO Book,
Sun Press and Prentice Hall 2003
Books with more than 300 pages:
  David Jordan and Craig Russell, Java Data Objects, O'Reilly & Associates,
Inc. 2003
  David Ezzio, Using and Understanding Java Data Objects, Apress 2003
Items in small categories:
  Object Identity
  Ogilvie Partners
  Smart Soft
Books published in 2002:
  Robin Roos, Java Data Objects, Addison-Wesley 2002
Categories containing an item with a short name:
  JDO Directory
  Consulting & Training

Step 4
The final step opens the visual manager window:

% java directory.step4.eMain





Copyright 2001-2007 ObjectDB Software. All rights reserved.