A Techno Blog, mainly about Java


JPOX: a free and full compliant JDO implementation released under an open source license.
JPOX Tutorial

JPOX Install info:
Setting up the environment requires EMF,,
You can download the the JPOX plugins here .
I also grabbed the which I extracted and added the folder to eclipse plugin folder. Note that to access the help after the doc plugin is in effect, do help contents in eclipse.

For my project, needed following Jars: bcel.jar, btree.jar, db2jcc.jar, jdo.jar, jdo-ri.jar, jdori-enhancer.jar, jpox-enhancer.jar, log4j.jar. Instead of using the jpox jar, we referenced a different project which contained the jpox source. In the jpoc source project, had the ant.jar, bcel.jar, btree.jar, connector-api.jar, db2jcc.jar, jdo.jar, jdori.jar, jdori-enhancer.jar,, log4j, and the oracle jars.

for the enhancer, I am running using WSAD. In run…, created a new application within my project. The class that is referenced is org.jpox.enhancer.JPOXEnhancer which executes on my projecting.jdo file (argument org/jpox/tutorial/package.jdo)

Reference the logging file to get info on how to set up log4j. I set up a JVM variable for my class : -Dlog4j.configuration=file:org/jpox/tutorial/

One thing to remember is to always run the enhancer after each compile.

Now, the which performs the persistance. One thing I noticed when I ran the class is that it creates the table, but nowhere is the schema indicated. Something I need to find out how to specify.

package org.jpox.tutorial;
import org.jpox.*;
import java.util.Properties;
import javax.jdo.JDOHelper;
import javax.jdo.PersistenceManager;
import javax.jdo.PersistenceManagerFactory;
import javax.jdo.Transaction;
import model.Person;
public class Main
public static void main(String[] args)
// Properties for connection
Properties properties = new Properties();


// PMFactory creation and getting the PM instance
PersistenceManagerFactory pmfactory = JDOHelper.getPersistenceManagerFactory(properties);
PersistenceManager pm = pmfactory.getPersistenceManager();

pm.currentTransaction().begin(); // opening a transaction

Person dude = new Person(); // creates one Person

Product product=new Product(“Sony Discman”,”A standard discman from Sony”,49.99);


pm.currentTransaction().commit(); // committing the transaction

// if the transaction is still active, rolls it back
if( pm.currentTransaction().isActive() )
pm.close(); // close the PM

Some of the packages in the jpox jdo include: javax.jdo, org.jpox.

a thesis has been written
comparing JDBC to JDO

Object Identity provides training for the JDO API.


JDO Implementations

OJB or now known as the apache db project.

July 25, 2004 - Posted by | CommonJ, JDO

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: