The Sun Java System Application Server communicates with the HADB in the same way that it communicates with relational databases used for data storage, therefore you need to set up a JDBC connection pool for the HADB as you would for any other database.
Using the clsetup
command is recommended for configuring a JDBC connection pool and JDBC resource for the HADB in the Sun Java System Application Server. This command is described in the Sun Java System Application Server Installation Guide.
Manual configuration of a JDBC connection pool and JDBC resource for the HADB is briefly summarized in these sections:
Before you can set up the JDBC connection pool, you need to determine the JDBC URL of the HADB using the hadbm get
command as follows:
hadbm get JdbcUrl [dbname]
For example:
hadbm get JdbcUrl
The JDBC URL is displayed on the standard output device in the following form:
jdbc:sun:hadb:host:port,host:port,...
Remove the jdbc:sun:hadb:
prefix and use the host:
port,
host:
port...
part as the value of the serverList
connection pool property, described in the next section.
The following table summarizes connection pool settings required for the HADB. Change Steady Pool Size when adding nodes, but do not change other settings.
The following table summarizes connection pool properties required for the HADB. Change serverList
when adding nodes, but do not change other properties.
Property |
Description |
---|---|
|
Specifies the name of the |
|
Specifies the |
|
Specifies the JDBC URL of the HADB. To determine this value, see "Getting the JDBC URL". You must change this value if you add nodes to the database. See "Adding Nodes to the HADB". |
|
Setting this property to |
|
Setting this property to |
|
Specifies the maximum number of statements per open connection that are cached in the driver statement pool. Set this property to |
Here is an example asadmin create-jdbc-connection-pool
command that creates an HADB JDBC connection pool. For more details about this command, see the Sun Java System Application Server Developer’s Guide to J2EE Services and APIs.
asadmin create-jdbc-connection-pool --user adminname --password secret
--datasourceclassname com.sun.hadb.jdbc.ds.HadbDataSource
--steadypoolsize=32 --isolationlevel=repeatable-read
--isconnectvalidatereq=true --validationmethod=meta-data --property
username=storename:password=secret456:serverList=host\\:port,host\\:port,host\\:p
ort,host\\:port,host\\:port,host\\:port:cacheDatabaseMetaData=false:eliminateRedund
antEndTransaction=true hadbpool
Note that colon characters (:
) within property values must be escaped with double backslashes (\\
) on Solaris platforms, because otherwise they are interpreted as property delimiter. On Windows platforms, colon characters (:
) must be escaped with single backslashes (\
).
The following table summarizes JDBC resource settings required for the HADB.
Setting |
Description |
---|---|
JNDI Name |
The following JNDI name is the default in the session persistence configuration:
You must also specify this JNDI name as the value of the |
Pool Name |
Select from the list the name (or ID) of the HADB connection pool used by this JDBC resource. For more information, see "Creating a Connection Pool". |
Data Source Enabled |
Checked/true |