3.4. Connecting to a Datastore

After a persistence-capable class has been defined, the next step is to implement an application that actually uses it. Any JDO application must get a connection to the underlying datastore before it can do anything. This is done by configuring an instance of PersistenceManagerFactory and then using it to get a PersistenceManager.

PersistenceManagerFactory is just a Java interface; JDO does not specify how an actual PersistenceManagerFactory instance should be created. However, it does provide a helper class called JDOHelper that, among other things, provides a common bootstrap mechanism to create a PersistenceManagerFactory instance based on a specified set of properties:

 static public PersistenceManagerFactory ...

Get Core Java™ Data Objects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.