You declare a data source to store the data used by Decision
Center.
Before you begin
You must have a database to create a data source.
For
a list of supported databases, consult the platform support details
available on the IBM support site.
About this task
To create a data source and a connection pool for Decision
Center on
Tomcat, you copy the driver for your database to the Tomcat directory,
declare the database, and then link the database to the Decision
Center archives.
Procedure
- Copy your database driver JAR file to the <CATALINA_HOME>/lib directory.
For example, the Derby embedded database driver is derby.jar,
which is available in <InstallDir>/shared/tools/derby/lib.
- Open the <CATALINA_HOME>/conf/server.xml file,
and declare the database just before the tag closing the global resources
definitions: </GlobalNamingResources>. For example:
<Resource name="jdbc/ilogDataSource" type="javax.sql.DataSource"
defaultTransactionIsolation="READ_COMMITTED"
auth="Container"
username="dcdbUser" password="dcdbUser"
driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
url="jdbc:derby:c:/dcdb;create=true"/>
Note: Adjust
the URL if you created the empty database in the previous step.
- Adjust the properties for local transaction data sources:
- defaultTransactionIsolation
Set the tag defaultTransactionIsolation to READ_COMMITTED to
avoid database access problems and hence provide a better concurrency
experience.
- username and password
The tags username="dcdbUser" and password="dcdbUser" are
used to access the database. The dcdbUser name and
password is only used to access the database.
- driverClassName
The class that is used to handle the connections to the database.
For example, for the Derby embedded database:
driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
- URL
The url property provides the JDBC connection. For example:
url="jdbc:derby:c:/dcdb;create=true"
A
database named dcdb is created the first time that
you access Decision
Center.
- Link the database to the Decision
Center archives
by adding the following code before the </Host> tag
that closes the localhost definition:
<Context docBase="teamserver" path="/teamserver" reloadable="false">
<ResourceLink global="jdbc/ilogDataSource" name="jdbc/ilogDataSource" type="javax.sql.DataSource"/>
</Context>
<Context docBase="decisioncenter" path="/decisioncenter" reloadable="false">
<ResourceLink global="jdbc/ilogDataSource" name="jdbc/ilogDataSource" type="javax.sql.DataSource"/>
</Context>
- Save the file.