InfoCenter Home >
6: Administer applications >
6.6: Tools and resources quick reference >
6.6.14: Administering database connections (overview) >
6.6.14.5: Additional administrative tasks for specific databases
6.6.14.5: Additional administrative tasks for specific databases
For your convenience, this article provides instructions for enabling some popular database
drivers, and performing other administrative tasks often required in order to provide data
access to applications running on WebSphere Application Server. These tasks are performed
outside of the WebSphere Application Server administrative tools, often using the database
product tools. Always refer to the documentation accompanying your database driver as the authoritative and
complete source of driver information.
See the WebSphere Application Server product
prerequisites for the latest information about supported databases, drivers, and operating systems.
To use SQL Server as the WebSphere Application Server administrative
repository, ensure that you have the WebSphere Application Server database in your SQL Server.
To create the Enterprise Manager in SQL server, complete the following steps:
- Go to the Enterprise Manager in SQL server and create a user EJSADMIN
for the WebSphere Application Server database with password EJSADMIN and database
administrator privileges.
- Create a user EJB on this database with password EJB and administrative privileges.
The default server in WebSphere Application Server uses these users.
Ensure that your operating system environment is set up to enable JDBC 2.0 use.
This is required in order to use data sources created through WebSphere Application
Server.
The following steps make it possible to find the appropriate JDBC 2.0 driver
for use with WebSphere Application Server administration:
To enable JDBC 2.0 use on Windows NT systems:
- Stop the DB2 JDBC Applet Server service.
- Run the following batch file:
SQLLIB\java12\usejdbc2.bat
- Stop WebSphere Application Server (if it is running) and
start it again.
Perform the steps once for each system.
Determining the level of JDBC in use for DB2 on Windows NT
To see whether the JDBC level in use on your system:
- If JDBC 2.0 is in use, this file will exist:
SQLLIB\java12\inuse
- If JDBC 1.0 is in use, this file will exist:
SQLLIB\java11\inuse or there will be no java11 directory
Before starting WebSphere Application Server, you need to call $INSTHOME/sqllib/java12/usejdbc2
to use JDBC 2.0. For convenience, you might want to put this in your root user's startup script.
For example on AIX, add the following to the root user's .profile:
if [ -f /usr/lpp/db2_07_01/java12/usejdbc2 ] ; then
. /usr/lpp/db2_07_01/java12/usejdbc2
fi
Determining the level of JDBC in use for DB2 on your UNIX system
To determine if you are using JDBC 2.0, you can echo $CLASSPATH. If it contains
$INSTHOME/sqllib/java12/db2java.zip
then JDBC 2.0 is in use.
If it contains
$INSTHOME/sqllib/java/db2java.zip
then JDBC 1.0 is in use.
Before starting WebSphere Application Server to host applications requiring
data access, source the db2profile:
.~db2inst1/sqllib/db2profile
where db2inst1 is the user created during DB2 installation.
Instructions are available for using JTA drivers on particular operating
systems. See your operating system's documentation for more information.
With the JDBC programming model underlying WebSphere Application Server
Version 4.0x, the term "JTA enabled" becomes somewhat odd, with respect to
its Version 3.5 meaning. The goal of this section about "Using JTA drivers" is
to provide information about the steps that make DB2 work nicely with applications
utilizing XA classes -- that is, those whose dataSourceClasses
implement javax.sql.XADataSource.
To enable JTA drivers for DB2 on Windows NT, follow these steps:
- Stop all DB2 services.
- Stop any other processes that use the db2java.zip file.
(Note: If the JVIEW process is active, you must use the
Task Manager utility to stop it.)
- Make sure that you already enabled JDBC 2.0.
- Start the DB2 services.
- Configure DB2 to use JTS as the transaction processing (TP) monitor.
From the DB2 Control Center, follow these steps:
- Right-click the DB2 instance that contains the database that
is to be enabled for JTA access.
- Click Multisite Update, Configure to start the Smartguide
utility.
- Click the Use the TP monitor named below radio button.
- Select JTS as the TP monitor.
- Click Done.
- Bind the necessary packages to the database. From the
DB2 Command Line Processor window, issue the following commands:
db2=> connect to mydb2jta
db2=> bind db2home\bnd\@db2cli.lst
db2=> bind db2home\bnd\@db2ubind.lst
db2=> disconnect mydb2jta
where mydb2jta is the name of the database that is to be
JTA enabled, and db2home is the DB2 root installation directory
path (for example, D:\ProgramFiles\SQLLIB\bnd\@db2cli.lst).
- When you use an IBM WebSphere Application Server administrative client (such
as the WebSphere Administrative Console) to configure a JDBC driver, specify
the following settings:
- Server class path =
%DB2_ROOT%/Sqllib/java/db2java.zip
- Implementation class name =
COM.ibm.db2.jdbc.DB2XADataSource
To enable JTA drivers on UNIX, follow these steps:
- Stop all DB2 services.
- Stop the IBM WebSphere Application Server administrative service.
- Stop any other processes that use db2java.zip file.
- Make sure that you already enabled JDBC 2.0.
- Start the DB2 services.
-
Bind the necessary packages to the database.
From the DB2 command-line process or window,
issue the following commands:
db2=> connect to mydb2jta
db2=> bind db2home\bnd\@db2cli.lst
db2=> bind db2home\bnd\@db2ubind.lst
db2=> disconnect mydb2jta
- When you use an IBM WebSphere Application Server administrative client (such
as the WebSphere Administrative Console) to configure a JDBC driver, specify
the following settings:
The Oracle 8.1.7 thin driver can be used for JTA two phase support with the
following restrictions:
- The thin driver that comes shipped with 8.1.7 may or may not work. Future
patches from Oracle may work as well, but have not been tested. The driver that
was available from the Oracle Technology Network Web site as of February 20, 2001
does work and is the recommended driver. Later versions on this Web site are expected
to work, but have not been tested.
To obtain the driver from the Oracle support Web, visit:
http://technet.oracle.com/
You will need to be a registered user for the Oracle Technology Network to get the driver
from this site. Contact Oracle for how to get access. After you have access:
- On the left hand side of the screen, select "Software".
- On "Download Oracle Products, Drivers, and Utilities"
- On the "Select a Utility or Driver" selection, select "Oracle JDBC Drivers".
- Download the 8.1.7 driver for the platforms you use and follow the instructions for installing the new driver.
The above instructions are subject to change with no notice to IBM. This version
of the instructions could become inaccurate. Consult the Oracle site for the definitive
instructions.
- The 8.1.7 driver must be used with 8.1.7 databases. 8.1.6 databases do not
support the recover() and forget() methods and other problems have been encountered running
with 8.1.6. Oracle does not support JTA with 8.1.6.
- For Oracle, JTA can only be used with container managed (CMP) beans.
- In order for the bean to create the table, the bean must first be started the JTA set to
false. After the bean has created the table, JTA can be set back to true.
- An entity bean that accesses Oracle with JTA set to true must be configured
as follows:
- In the deployment descriptor properties, under Transactions, under the Remote tab,
set the Transaction Attribute to REQUIRED.
- Under Isolation, under the Remote tab, set the Isolation Level to READ_COMMITTED.
- A session bean that is used with an entity bean that accesses Oracle with JTA set to
true must be configured as follows:
- In the deployment descriptor properties, under Transactions, under the Remote tab,
set the Transaction Attribute to BEAN_METHOD.
- Under Isolation, under the Remote tab, set the Isolation Level to READ_COMMITTED.
To enable JTA drivers for use with Sybase on the AIX operating system,
follow these steps:
- At a command prompt, enable the Data Transaction Manager (DTM) by issuing these commands (one per line):
isql -Usa -Ppassword -Sservername
sp_configure "enable DTM", 1
go
- Stop the Sybase Adaptive Server database and start it again.
- At a command prompt, grant the appropriate role authorization
to the EJB user:
isql -Usa -Ppassword -Sservername
grant role dtm_tm_role to EJB
go
Do not use a Sybase JTA connection in an enterprise bean method
with an unspecified transaction context. A Sybase JTA connection
does not support the local transaction mode. The implication is
that the Sybase JTA connection must be used in a
global transaction context.
|
|