
Chapter 19
Database Connectivity
19.1 Introduction
This chapter discusses Rhino SLEE configuration, and recommendations for programming applications which connect to an
external SQL database.
Rhino SLEE can connect to any external database which has support for JDBC 2.0 and JDBC 2.0’s standard extensions
1
.
Application components such as Resource Adaptors and Service Building Blocks may execute SQL statements against the
external database.
A systems administrator can configure new JDBC datasources for use by the SBBs or resource adaptors. The Rhino SLEE must
be offline mode when configuring an external Database source.
Note: The PostgreSQL database which is used to persist the main working memory is separately configured than applica-
tions which use an external database as an application resource. For more information regarding main working memory
please refer to Section 4.2.10 in Chapter 4.
For more information regarding installing PostgreSQL please refer to Chapter 21.
19.2 Configuration
External database sources are added to the database manager by configuring the file
$RHINO_HOME/etc/defaults/config/
rhino-config.xml
.
The <
ejb-resources
> element must have at least one<
jdbc
> elements present.
Each <
jdbc
> element contains a mandatory <
jndi-name
> element. The <
jndi-name
> element identifies the JNDI name
that the database will be bound into the JNDI tree. for example the location
java:resource/jdbc/
<
jndi-name
>
The JNDI location is not accessible to SBBs directly. Each SBB is link to this JNDI name in the SBB deployment
descriptor. For more information on SBB deployment descriptor entries please see Section 19.4.
Each <
jdbc
> element contains mandatory <
datasource-class
> elements. This element specifies the name of the Java
class file that implements the
javax.sql.DataSource
interface or the
javax.sql.ConnectionPoolDataSource
interface.
For more information on the distinction between these interfaces and their implications for connection pooling in Rhino please
refer to Section 19.2.1.
The JDBC specification defines that each DataSource has a number of JavaBean properties. To configure the JavaBean proper-
ties for each DataSource, add <
parameter
> elements to the <
jdbc
> element.
It is expected that a minimum parameter element will be specified that informs the JDBC driver where to connect to the
database server.
1
see
http://java.sun.com/products/jdbc
113
Komentarze do niniejszej Instrukcji