Targeting
a Data Source
This
is the second opportunity to deploy a JDBC to a target. Any previous targets
are prechecked
when this page is displayed. When you target a JDBC data source, a new instance
of the data source is created on the target. When you select a server as a
target, an instance of the data source is created on the server. When you
select a cluster as a target, an instance of the data source is created on all
member servers in the cluster.
1. Navigate
to the data source that you want to modify and click the Targets tab.
2. Select
each server or cluster on which you want to deploy the data source and click
Save.
Viewing
the Server JNDI Tree via the Administration Console
The
screenshot in the slide shows viewing the Java Naming and Directory Interface
(JNDI)
tree. If the data source is deployed successfully, a new entry should be added
to the local JNDI tree of the target servers. The name of the entry should
match the JNDI name that is used to configure the data source. If you use a
fully qualified JNDI name containing path separators (for example, “hr.datasource.HRDataSource”
instead of just MedRecHR),
the entry will not be found at the root of the tree. Instead, directories are
created to match the fully qualified name, if they do not already exist, with
plus and minus icons to expand and collapse them.
1. In
the left pane, expand Environment > Servers. Then select a specific server.
2. On
the default Configuration > General tab of the server, click View JNDI Tree.
The JNDI tree is displayed in a new browser window or browser tab.
3.Use
the left panel to navigate the directories of the JNDI tree.
Note:
When you create contexts and bind objects programmatically, the subcontext
will not be auto-created (therefore, subcontexts
must be programmatically created before objects are placed into them); but when
a JNDI entry is configured using the Administration Console as shown here, then
the subcontext
will be automatically created for you.
Monitoring
and Testing a Data Source
After
you create a JDBC data source and target it to one or more servers, you can
monitor it in the Administration Console. Locate and select your new data
source and click the Monitoring > Statistics tab. Statistics are displayed
for each deployed instance of the data source. Optionally, click “Customize
this table” to change the columns displayed in the Statistics table. For
example, some of the available columns (not displayed by default) include:
•Active Connections Current Count:
The number of connections currently in use by applications
•Active Connections Average Count:
The average number of active connections from the time that the data source was
deployed
•Connections Total Count:
The cumulative total number of database connections created in this data source
from the time that the data source was deployed
•Current Capacity:
The current count of JDBC connections in the connection pool in the data source
•Highest Num Available:
The highest number of database connections that were available at any time in
this instance of the data source from the time that the data source was
deployed
•Waiting for Connection High Count:
The highest number of application requests concurrently waiting for a
connection from this instance of the data source
Connection
Pool Life Cycle
By
default, a connection pool is automatically started when it is deployed. You
can manually stop and restart the connection pool. This might be necessary if
you change the username/password or some other characteristic of the
connection. If you wanted to gracefully shut down an application, you might
start by shutting down the connection pool.