git-svn-id: https://svn.jboss.org/repos/hibernate/trunk/Hibernate3/doc@6445 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Christian Bauer 2005-04-17 22:22:32 +00:00
parent 4d934c1733
commit d8efc15471
1 changed files with 43 additions and 42 deletions

View File

@ -6,7 +6,8 @@
<para>
This tutorial explains a setup of Hibernate 3.0 with the Apache Tomcat
servlet container for a web-based application. Hibernate works
servlet container (we used version 4.1, the differences to 5.0 should be
minimal) for a web-based application. Hibernate works
well in a managed environment with all major J2EE application servers, or
even in standalone Java applications. The database system used in this
tutorial is PostgreSQL 7.4, support for other database is only a matter
@ -101,7 +102,7 @@
</row>
<row>
<entry>
CGLIB (required)
CGLIB, asm (required)
</entry>
<entry>
Hibernate uses the code generation library to enhance classes
@ -162,7 +163,8 @@
We now set up the database connection pooling and sharing in both Tomcat and
Hibernate. This means Tomcat will provide pooled JDBC connections (using its
builtin DBCP pooling feature), Hibernate requests theses connections through
JNDI. Tomcat binds the connection pool to JNDI, we add a resource declaration
JNDI. Alternatively, you can let Hibernate manage the connection pool. Tomcat
binds its connection pool to JNDI; we add a resource declaration
to Tomcats main configuration file, <literal>TOMCAT/conf/server.xml</literal>:
</para>
@ -226,11 +228,10 @@
<para>
Your next step is to configure Hibernate. Hibernate has to know how it should obtain
JDBC connections We use Hibernates XML-based configuration. The other approach, using
a properties file, is equivalent in features, but doesn't offer any advantages. We use
the XML configuration because it is usually more convenient. The XML configuration file
is placed in the context classpath (<literal>WEB-INF/classes</literal>), as
<literal>hibernate.cfg.xml</literal>:
JDBC connections. We use Hibernate's XML-based configuration. The other approach, using
a properties file, is almost equivalent but misses a few features the XML syntax allows.
The XML configuration file is placed in the context classpath (<literal>WEB-INF/classes</literal>),
as <literal>hibernate.cfg.xml</literal>:
</para>
<programlisting><![CDATA[<?xml version='1.0' encoding='utf-8'?>