Chapter 2. Setup

Table of Contents

2.1. Tutorial Files
2.2. Important Utilities

If you haven't already, follow the instructions in the Kodo JDO README. This will ensure that your CLASSPATH and other environmental variables are set up correctly. Once you've completed the installation instructions, change into the reversetutorial directory.

2.1. Tutorial Files

The tutorial uses the following files:

  • The hsql_sample_database.properties, hsql_sample_database.script, and hsql_sample_database.data files make up a Hypersonic SQL file-based database with the schema outlined above. The database is already populated with lots of magazine data representing your shop's inventory.

  • reversetutorial.JDOFactory provides access to a properly configured javax.jdo.PersistenceManagerFactory .

    The PersistenceManagerFactory class is the main entry point into the JDO framework. PersistenceManagerFactories provide a mechanism for obtaining individual PersistenceManager instances, through which a user can find objects in the underlying data store. See the javax.jdo javadoc for a more in-depth discussion of JDO in general and the PersistenceManagerFactory class in particular.

  • reversetutorial.Finder uses JDO to execute user-entered query strings and output the matching persistent objects. This class relies on persistent classes that we haven't generated yet, so it won't compile immediately.

  • kodo.properties is a properties file containing Kodo-specific and standard JDO configuration settings.

    Note that if you've changed your kodo.properties settings to access another database, you'll have to change them back for this tutorial. Reset the following properties:

    javax.jdo.option.ConnectionDriverName=org.hsqldb.jdbcDriver
    javax.jdo.option.ConnectionUserName=sa
    javax.jdo.option.ConnectionPassword=
    javax.jdo.option.ConnectionURL=jdbc:hsqldb:hsql_sample_database
    				

    You might also want to change switch SQL logging from standard output to a file for the purposes of this tutorial. Change the Logger property to look like this:

    com.solarmetric.kodo.Logger=sql.txt
    				
    Important

    You must specify a valid Kodo license key in the kodo.properties file.

  • solutions contains the complete solutions to this tutorial, including all generated code.