이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 4. Configuring Hibernate for Red Hat JBoss Web Server
Hibernate ORM is an object-relational mapping framework that lets you connect JBoss Web Server to JDBC datasources.
4.1. Installing Hibernate ORM 링크 복사링크가 클립보드에 복사되었습니다!
Complete the following procedure to install Hibernate ORM on all platforms that JBoss Web Server supports.
Prerequisites
Configure your project to use the JBoss Web Server Maven Repository, which is available to download as jboss-web-server-5.5.0-maven-repository.zip.
Procedure
- Get the Hibernate JAR files from the JBoss Web Server Maven Repository.
- Add the Hibernate JAR files to your deployment WAR file.
4.2. Configuring JDBC Connection Pools 링크 복사링크가 클립보드에 복사되었습니다!
Tomcat provides a default connection pooling mechanism for JDBC datasources.
Procedure
-
Open your deployment’s
/META-INF/context.xmlfile for editing. Modify the JDBC connection pools available to applications, as in the following example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
4.3. Configuring Hibernate Connection Properties 링크 복사링크가 클립보드에 복사되었습니다!
Configure Hibernate to use connections from the Tomcat pool. If you use the Hibernate API directly, use a similar configuration to hibernate.cfg.xml.
Procedure
-
Open your deployment’s
/WEB-INF/classes/META-INF/persistence.xmlfile for editing. Configure how Hibernate consumes connections from the Tomcat, as in the following example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
4.4. Adding JDBC Data Sources 링크 복사링크가 클립보드에 복사되었습니다!
Configure Tomcat to consume JDBC datasources.
Procedure
-
Open your deployment’s
/WEB-INF/web.xmlfile for editing. Configure JDBC datasources with the
resource-env-refelement, as in the following example that uses ajdbc/DsWebAppDBdatasource:Copy to Clipboard Copied! Toggle word wrap Toggle overflow