Java Reference
In-Depth Information
Figure B-22. Selecting default values for the configuration file
All the values selected in the drop-down menus can be overtyped if the option you need is
not listed. (Note that we have amended the connection URL with our preferred HSQLDB con-
nection details.) You can type in the fully qualified dialect class name instead of choosing from
the short names available from the drop-down list.
At this point, you also have the option of selecting the Create a console configuration
check box. If you do so, the Hibernate Configuration File wizard will pass you to the Hibernate
Console Configuration wizard (and will automatically populate the configuration file field).
However, since we've already discussed this earlier in the chapter, leave the check box empty
and click Finish.
The resulting example.cfg.xml file is shown in the following code (slightly reformatted to
ensure that it fits on the page). Unlike the generated mapping files, this configuration file is
pretty much ready to use if you plan to use programmatic configuration of your application,
or if you are using it purely as the basis of a Hibernate Console configuration to connect to an
existing Hibernate database.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">
org.hsqldb.jdbcDriver
Search WWH ::




Custom Search