Configuring Access to Database Systems
Overview
Before a server can connect to a database, the server must first receive information about the database. You supply database connection information by configuring a database alias. You must configure database aliases if you want to create database flow services.
This chapter describes what a database alias consists of and how to identify, update, and delete a database alias in the Integration Server Administrator.
Supported Databases
The webMethods Integration Server can connect to the following databases using WmDB:
- Oracle 8i and 9i
- SQL Server 2000
- DB2 UDB 8.1
- MS SQL 7
- MS Access
WmDB connects to these databases using the JDBC driver provided by the vendor.
Database Connection Information
A database alias consists of the following information:
-
The type of
database and where it is located. JDBC uses a URL naming scheme to locate
and identify databases. Each JDBC driver responds to a slightly different
syntax for these URLs. Consult the documentation for the driver you are using
for details. If you are using the JDBC-ODBC bridge driver, the URL is
jdbc:odbc:your-datasource
. - The user name and password required to connect to the database. If the database requires a user name and password to connect to it, you must specify the server with the user name and password it should supply.
-
The JDBC
driver. You identify the fully qualified Java class name of the JDBC
driver to use for this connection (for example,
com.company.jdbc.Driver
). This class must be in the server’s classpath.
The server uses the database connection information to connect to a database when:
- You use the Integration Server Administrator to display information about database tables when creating a database service (Generate from table). The server must connect to the database to get information about the structure of the database.
- The server executes a database service that was created using the Integration Server Administrator.
About the Server Configuration File
The server configuration file (server.cnf), located in the Integration Server_directory \instances\instance_name\config directory, contains the parameters you will add to control the server connection to the database.
The following table describes the parameters that you must add to server.cnf to specify database connection settings:
This parameter... | Specifies... |
---|---|
watt.server.db.connectionCache | How the server
manages connections to a database.
|
watt.server.jdbc.defaultDriver | The name of the Java class for the driver you want to use to connect to databases when no driver name is supplied for a database alias. For more information, see Identifying Database Aliases. |
watt.server.jdbc.driverList | A comma-delimited list of JDBC drivers you want the server to load when it initializes. There is no default. For more information, see Preloading JDBC Drivers at Server Initialization. |
Preloading JDBC Drivers at Server Initialization
About this task
To have the server load JDBC drivers when it
initializes, specify a comma-delimited list of JDBC drivers that you want
preloaded in the
watt.server.jdbc.driverList
field in
the server.cnf file in the
Integration Server_directory
\instances\instance_name\config directory.
If this field does not exist in the server.cnf file, you can add it. To change
this setting use the
Settings > Extended page from the
Integration Server Administrator as described in
Working with Extended Configuration Settings.
Making the Java Classes for JDBC Drivers Accessible
About this task
To place the classes in the server’s classpath, place the .zip or .jar file containing the classes in the Integration Server_directory \lib\jars\custom directory. If the jars or custom subdirectories do not exist, create them. The server will automatically add the .zip or .jar libraries to its classpath.
If a patch you are unzipping or “unjarring” overwrites existing classes, be sure to back up the existing classes in case the patch does not work.
sun.jdbc.odbc.JdbcOdbcDriver
. An ODBC
data source corresponding to your database
must exist.
If the server does not have access to the Java classes for the JDBC driver, users receive the following error when the server attempts to connect to the database:
Could not connect: No suitable driver
If the driver loads successfully but cannot connect to the database for some reason, the resulting error message usually includes some driver-specific codes or messages. The most common source of such errors is an invalid user name or password on the database. Consult your driver documentation for details.
Identifying Database Aliases
About this task
- You want developers to be able to define database flow services using the webMethods Integration Server Administrator.
- You want to maintain all database connection parameters in one place to allow for easier maintenance. For example, you can easily update the information if a password changes or a database moves.
To better manage requests for database connections, you can specify that the server use database connection pools. With database connection pools in effect, the Integration Server controls the number of database connections it makes to a database, preventing the database from exceeding its connection limit and rejecting requests. If a request exceeds a database connection pool’s limit, the server blocks it and tries the connection request again later.
See Enabling Database Connection Pooling for more information about how database connection pools work and how to set them up.
To identify a database alias
Procedure
Enabling Database Connection Pooling
About this task
The pool controls the number of connections a server can have to the database at any given time. For example, if your database allows 50 connections and you have five servers that connect to the database, you can limit each server’s database connection pool to 10. This way, the number of connections to the database never exceeds 50 and no requests will be rejected due to lack of available slots. If the number of connection requests to a server exceeds 10, that server will block the request and try it again later. The request will not be rejected.
Without database connection pooling, each server will obtain as many connections to the database as requested until the database reaches its limit of 50. Subsequent requests will be rejected by the database until the number of database connections drops down below 50.
When you enable database connection pooling, it applies to all databases defined to the server. In other words, the server will maintain a connection pool for each database for which an alias is defined. You can, however, control the characteristics of each pool individually. For example, you might specify more connections for a large, busy database than for a small, relatively quiet one.
Use the following procedure to enable database connection pooling for your server.
To enable database connection pooling
Procedure
Updating Information for Database Aliases
About this task
To update information for a database alias
Procedure
- Open the Integration Server Administrator if it is not already open.
- Go to Adapters > WmDB > Alias Management.
- From the Current Data Sources field, select the database alias for the database you want to update.
- Click Edit. The server displays the Edit Alias Information page.
- Set the alias parameters. For information about what to specify for each of the fields, refer to the procedure in Identifying Database Aliases.
- Click Submit.
- If you changed the Minimum Connections or Maximum Connections alias parameters, restart the server for the changes to take effect.
Deleting Database Aliases
About this task
To delete a database alias
Procedure
- Open the Integration Server Administrator if it is not already open.
- Go to Adapters > WmDB > Alias Management.
- From the Current Data Sources list, select the database alias you want to delete.
- Click Delete. The server issues a prompt to verify that you want to delete the database alias.
- Click OK to delete the database alias.