JPOX Install info:
Setting up the environment requires EMF, com.versant.eclipse.jdo_0.9.9_e2.zip, com.versant.eclipse.jdo.jpox_0.9.9_e2.zip.
You can download the the JPOX eclipsejdo.org plugins here .
I also grabbed the com.versant.eclipse.jdo.doc.user_0.9.9_e2.zip 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, jta.zip, 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/log4j.properties
One thing to remember is to always run the enhancer after each compile.
Now, the main.java 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.
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.
OJB or now known as the apache db project.
IBM & BEA Share the Technologies (commonJ). Consists of SDO (originally IBM called it Websphere Data Object but renamed to SDO), WorkManager for Application Servers (API to schedule work items for concurrent execution), and Timer for Application Servers (API for setting timers to do work actions like CRON within container).
They approached each other, then created JSR235: “Defines core infrastructure APIs for heterogeneous data access that supports common application design patterns and supports higher-level tools and frameworks.”
Webspshere 6 is slated to include SDO later this year. JSF with SDO redbook
With SDO it is what do you want to do, not what technology do you want to use. A higher level of abstraction.
More easily to bind, query, view, update, introspect data.
The data comes from different places (heterogeneity), decouple application code from data access code.
Support for Tools and Object/Relational disconnect.
SDO has API that is applicable to all types of data sources, dont assume back end store.
Based upon disconencted data graphs (tree or graph structured data) – retrieve graph, update the graph, and apply changes back to data source.
Access to data with classes which use data mediator services.
Data Transfer Object – move several pices of data over the network in a
single call in order to reduce number of method calls. Usually an assember is
used to keep the domain model and the data transfer objects independednt of each