Java Reference
In-Depth Information
features in Appendix B. Again, the archive should be downloaded and unpacked to a local
directory. This archive does not include the source code (which is available elsewhere on the
www.hibernate.org site, if you decide to take a look at it).
HSQLDB 1.8.0
The database we will be using in our examples is the HSQL database. This is written in Java
and is freely available open source software. While we used version 1.8.0.2 for our exam-
ples, we expect that any later version will be suitable. HSQL is derived from code originally
released as “Hypersonic.” You may encounter the term in some of the HSQL documenta-
tion and should treat it as synonymous with “HSQL.” We may also refer to the product as
HSQLDB when it might otherwise be mistaken for Hibernate Query Language (HQL),
whose acronym is distressingly similar!
Our examples are tailored to HSQL because HSQL will run on any of the platforms that
Hibernate will run on, and because HSQL is freely available with minimal installation require-
ments. However, if you want to run the examples with your own database, then the differences
should boil down to the following:
The Hibernate dialect class
The JDBC driver
The connection URL for the database
The username for the database
The password for the database
You will see where these can be specified later in this chapter. You will notice that where
we specify the URL for connection to the database, we often append a shutdown=true attrib-
ute. This fixes a minor problem in which HSQLDB does not write its changes to disk until a
Connection object is closed (something that may never happen when a connection is being
managed by Hibernate's own connection pooling logic). This is not necessary on non-
embedded databases.
Ant 1.6.5
You will want to install the Ant build tool. We will not attempt to explain the build.xml format
in detail; if you are familiar with Ant, then the example build script provided in this chapter will
be enough to get you started—if not, then Ant is a topic in its own right. We would recommend
Enterprise Java Development on a Budget , by Christopher M. Judd and Brian Sam-Bodden
(Apress, 2004), for good coverage of open source tools such as Ant.
While Ant in general lies outside the scope of this topic, we will discuss the use of the
Hibernate tasks used by our scripts.
Listing 3-1 provides the Ant script to build the example for this chapter.
Search WWH ::




Custom Search