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.
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.
To enable JTA drivers for DB2 on Windows NT, follow these steps:
- Stop all DB2 services.
- Stop the IBM WebSphere Application Server administrative service.
- 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:
- Class name =
COM.ibm.db2.jdbc.app.DB2Driver
- URL prefix =
jdbc:jta:db2
- JTA enabled =
True
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.
- 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:
- Class name =
COM.ibm.db2.jdbc.app.DB2Driver
- URL prefix =
jdbc:jta:db2
- JTA enabled =
True
To enable JTA drivers for use with Oracle via SequeLink on the
Windows NT operating system, follow these steps:
- Setting up Oracle 8.1.6:
- Setting up direct database authentication through SequeLink Manager:
- In SequeLink Services, SLOracle51, Configuration,
Service Settings, and User Security, set ServiceAuthMethods
to Anonymous.
- In SequeLink Services, SLOracle51, Configuration,
Data Source Settings, Default, and User Security, set
DataSourceLogonMethod to DBMSLogon(UserID,Password).
- Because the XAOpen string, containing the user ID and password, is stored
in the trace log, to ensure security, enter the following setting:
In SequeLink Services, SLOracle51, Configuration,
Service Settings, Logging set ServiceDebugLogLevel
to either Fatal or Errors.
- Setting up WebSphere Application Server:
- When you create your new JDBC driver, the URL prefix defaults to the following:
jdbc:sequelink//hostname:19996
Change hostname to the name of your machine, and enter the port number you
are using, represented here by the SequeLink default of :19996.
- When you create the data source, enter the Oracle environment variable ORACLE_SID
in the Database Name field.
Enter the Oracle environment variable ORACLE_SID.
- Select your server, and on the General tab, click Environment.
Add the CLASSPATH variable, and set its value to the path in which
the SequeLink Client is installed, for example:
#$WAS_HOME/driver/lib/sljcx.jar
where $WAS_HOME is the location where WebSphere Application Server is installed.
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.
Here are some tips for selecting JDBC drivers:
- For DB2, consider type 2 application drivers, which are typically faster
than type 2 network drivers.
- DB2 6.1 on HPUX does not support JDBC 2.0.
- For Sybase, consider type 4 thin drivers.
- On Sybase, JDBC 2.0 support is provided by the jConnect 5.2 component
- For Oracle, consider type 4 thin drivers.
|
|