Create a data source to connect to the Decision Center database.
Before you begin
Unless you are using Db2® embedded, you must have a database before creating a data source (see Mandatory: Create the databases).
For a list of supported databases, consult the platform support details available on the IBM® support site
.
About this task
To connect to the Decision Center database
on the WebSphere
Liberty profile,
copy your database driver to the WebSphere
Liberty profile
directory and declare the data source.
Procedure
- Copy the database driver to a directory, which you then specify in the
server.xml file when you declare the data source.
For example, the Db2 embedded database driver is db2jcc4.jar.
- In <WLP_HOME>/usr/servers/<SERVER_NAME>/server.xml,
declare the data source:
<!-- Decision Center data source -->
<library id="db2-library">
<fileset dir="${shared.resource.dir}/dbe" includes="db2jcc4.jar db2jcc_license_cisuz.jar" /> </library>
<dataSource
id="dcdatasource"
isolationLevel="TRANSACTION_READ_COMMITTED"
jndiName="jdbc/ilogDataSource" statementCacheSize="100">
<connectionManager maxPoolSize="20" minPoolSize="5" connectionTimout="10s" agedTimeout="30m"/>
<jdbcDriver libraryRef="db2-library"/>
<properties.db2.jcc
driverType="4"
databaseName="odmdc"
serverName="mydb2server.com"
portNumber="50000"
currentLockTimeout="120s"
user="dcdbUser"
password="dcdbUser"/>
</dataSource>
- Adjust the properties for local transaction data sources:
- driver path
- The
<fileset> tag specifies the path to the driver that is used to handle
the connections to the database.
- isolationLevel
- Set the tag
isolationLevel to TRANSACTION_READ_COMMITTED to
avoid database access problems and hence provide a better concurrency
experience.
- username and password
- The properties
user="dcdbUser" and password="dcdbUser" are
only used to access the database.
- database name
- The property
databaseName="odmdc" provides the JDBC connection. A database
named odmdc is created the first time you access Decision Center.
- Save the file.