Before we can start implementing the Model layer of our application, we first have to create a database environment.
In our example application, we are going to use Java DB, which is a relational database that is bundled with the Java Development Kit (JDK). Of course, any other database can be used, but Java DB seems a good choice for an example application because everyone who has a JDK already has it installed. For completeness, we’re starting out by setting up the database environment.
Note
Java DB is nothing more than a rebranded version of Apache Derby, an open source relational database implemented entirely in Java. The version bundled with the JRE 1.6 is Derby 10.4. Extensive documentation about Java DB/Derby can be found on the Apache Derby website at http://db.apache.org/derby/docs/10.4/. We will refer to the database as Java DB. But wherever Java DB is mentioned, you can read Derby as well if you like.
The Java DB database has several...