Skip to Main Content
Enterprise JavaBeans, Fourth Edition
book

Enterprise JavaBeans, Fourth Edition

by Sacha Labourey, Bill Burke, Richard Monson-Haefel
June 2004
Intermediate to advanced content levelIntermediate to advanced
792 pages
23h 17m
English
O'Reilly Media, Inc.
Content preview from Enterprise JavaBeans, Fourth Edition

Appendix A. Database Configuration

This appendix describes how to set up database pools for data sources other than the default database embedded in JBoss, Hypersonic SQL. It also shows you how to set up your EJBs to use these database pools. For illustration purposes, we’ve modified Exercise 6.1 to configure and use an Oracle connection pool with JBoss.

Set Up the Database

To deploy a database connection pool, JBoss requires a datapool configuration file. The configuration file is very simple, yet can be used for almost all standard datapool setups.

Basic Setup

The first step is to download the JDBC driver classes for your database. Copy your database’s JDBC JAR file to $JBOSS_HOME/server/default/lib. For example, the Oracle JDBC class files are contained in classes12.zip.

The JBoss distribution includes example database connection-pool files, in the directory $JBOSS_HOME/docs/examples/jca. The name of each file ends in -ds.xml. For this exercise, we’ve copied the oracle-ds.xml configuration file to exAppendixA/titandb-ds.xml and modified it accordingly.

To deploy this connection pool, you must copy titandb-ds.xml to the $JBOSS_HOME/service/default/deploy directory. Note that the name of this config file must end with -ds.xml, or JBoss will not deploy it.

Tip

Database connection pools are among the many things that can be hot-deployed in JBoss, simply by plopping the pool’s XML configuration file into the deploy directory.

Examine some of the configuration parameters this file defines. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Enterprise JavaBeans, Third Edition

Enterprise JavaBeans, Third Edition

Richard Monson-Haefel
Enterprise JavaBeans 3.1, 6th Edition

Enterprise JavaBeans 3.1, 6th Edition

Andrew Lee Rubinger, Bill Burke
Enterprise JavaBeans 3.0, 5th Edition

Enterprise JavaBeans 3.0, 5th Edition

Richard Monson-Haefel, Bill Burke

Publisher Resources

ISBN: 059600530XSupplemental ContentCatalog PageErrata