Skip navigation.
Downloads | Product Documentation | Support

Creating WebLogic Configurations Using the Configuration Wizard

# Configuring a Database Service

WebLogic JDBC enables Java programmers to interact with common database management systems (DBMS) such as Oracle, Microsoft SQL Server, Sybase. The wizard gives you the option of configuring a database service by defining several WebLogic JDBC components:

- Connection pools—Ready-to-use group of connections to your DBMS
- MultiPools—Groups of connection pools
- Data sources—Interfaces between applications and connection pools

The Database (JDBC) Options window prompts you to decide whether you want to configure a database service.

- If you select No, the wizard uses the configuration settings exactly as defined in the configuration source that you selected earlier.
- If you select Yes, you are prompted in subsequent windows to define the configuration you want, as described in the following table.

For this task . . . | Do the following . . .
--- | ---
Configuring JDBC Connection Pools (Optional) | Create ready-to-use pools of connections to your DBMS. This task is a prerequisite for configuring JDBC MultiPools.
Configuring JDBC MultiPools (Optional) | Set up a group of JDBC connection pools to accommodate either a high-availability algorithm or a load-balancing algorithm. This window is displayed only if you have defined at least one JDBC connection pool.
Assigning JDBC Connection Pools to MultiPools (Optional) | Assign the JDBC connection pools to the defined JDBC MultiPools. This window only is displayed only if you define one or more JDBC connection pools and JDBC MultiPools.
Configuring JDBC Data Sources (Optional) | Configure the data sources that are bound to the JNDI tree and assign a JDBC connection pool. A data source object enables JDBC applications to obtain a DBMS connection from a connection pool. This window is displayed only if you have defined at least one JDBC connection pool.
Testing JDBC Connection Pools and Setting Up a JDBC Database (Optional) | Test your JDBC connection pool configurations on the local machine. This window is displayed only if you have defined at least one JDBC connection pool.
Setting Up the JDBC Database Content (Optional) | Set up the database content used by the applications in your domain using pre-existing SQL or database loading files. A configuration template may contain a set of SQL files organized by database type. This window is displayed only if the following statements are true: You have defined at least one JDBC connection pool. The configuration template contains one or more SQL files.

## Related Topics

Programming WebLogic JDBC at http://e-docs.bea.com/wls/docs81/jdbc/index.html

Tutorial: Creating a Custom Domain With Managed Servers, a Cluster, and Application Services

# Configuring JDBC Connection Pools

Connection pools provide ready-to-use groups of connections to your DBMS. Client-side and server-side applications can utilize connections from a connection pool through a data source on the Java Naming and Directory Interface (JNDI) tree.

The Configure JDBC Connection Pools window prompts you to create a pool of JDBC connections. This step is optional. However, before you can define a MultiPool, you must first define its constituent connection pools.

Note: The configuration values that you specify for your database in this window must match the actual configuration of the database. For example, if you change the name of the PointBase database for a preconfigured domain in the DBMS name field in this window, you must also change the name of the actual PointBase database.

#### To configure JDBC connection pools:

1. Review the current list of JDBC connection pools. Default values may vary, based on the configuration source you selected earlier.

Note: The wizard provides two views: a concise tabular view of all the defined components, and an individual view, in which each component is represented by a tab, and you view a particular component by selecting the corresponding tab. To toggle the display mode between table and tab formats, click Switch Display.

2. Add or modify entries as required by your configuration, using the guidelines provided in the following table. (Fields marked with an asterisk are required.) To delete a JDBC connection pool configuration, click in one of its fields and click Delete. When you finish updating your settings, click Next.

In this field . . . | Do the following . . .
--- | ---
Name* | Enter a valid name for a JDBC connection pool: a string of characters that can include spaces. The name of the JDBC connection pool must be unique among all configuration component names within the domain. The default value in this field is `new_JDBCConnectionPool_``n`, where `n` specifies a numeric value that is used to differentiate among the default names of connection pools; the value of `n` for the first connection pool is 1. The value is incremented by 1 for each connection pool that is added.
Vendor* | From the drop-down list, select the DBMS of the database to which you want to connect. If your DBMS is not listed, select `Other`.
Driver* | From the drop-down list, select the JDBC driver you want to use to connect to the database. The list includes common JDBC drivers for the selected DBMS. If you selected `Other` in the Vendor field, this field is not available.
Class name* | If you selected a DBMS in the Vendor field, no action is required. If you selected `Other` in the Vendor field, enter the full package name of the class that implements the `java.sql.Driver` interface for your DBMS.
DBMS name* | Enter the name of the database. If you selected `Other` in the Vendor field, this field is not available.
DBMS host* | Enter the name of the server machine hosting the database. If you selected `Other` in the Vendor field, this field is not available.
DBMS port* | Enter the port to be used to connect to the server. The default setting associated with the database selected is displayed. If you selected `Other` in the Vendor field, this field is not available.
JDBC URL* | If you selected a DBMS in the Vendor field, no action is required. If the DriverName has been set and a default URL exists, that URL is used as the value of this field. If you selected `Other` in the Vendor field, enter the URL for the database that is used to create the connections in the connection pool.
User name* | Enter the account login name required for connecting to the database. If you selected `Other` in the Vendor field, this field is not available.
User password* | Enter a password that is valid for accessing the database. Valid values consist of a string of alphanumeric characters. The hyphen (-) and underscore ( _ ) characters are supported. This password overrides the password entered as part of the JDBC `Properties`. The value is encrypted.
Confirm user password* | Re-enter the user password.
Known properties | If you selected a DBMS in the Vendor field, no action is required. This field displays the properties list passed to the JDBC Driver for use in the creation of physical database connections. If you selected `Other` in the Vendor field, this field is blank.
Additional properties | Enter any additional properties to be passed to the JDBC driver. Some JDBC drivers, such as DataDirect for DB2 or Informix, display specific properties in this field. For properties of the type, you must specify values. The properties shown in this field vary, based on which DBMS you select.
Supports Local Transaction | Select the check box to enable the support of local transactions. The default is disabled.

## Related Topics

"Overview of Connection Pools" in Programming WebLogic JDBC at http://e-docs.bea.com/wls/docs81/jdbc/intro.html#intro018

Tutorial: Creating a Custom Domain With Managed Servers, a Cluster, and Application Services

# Configuring JDBC MultiPools

A JDBC MultiPool is a group of JDBC connection pools that you can set up to accommodate either a high-availability algorithm or a load-balancing algorithm. It is used the same way a connection pool is used.

The Configure JDBC MultiPools window prompts you to configure JDBC MultiPools. This window is displayed only if you have defined at least one JDBC connection pool. This step is optional.

#### To configure JDBC MultiPools:

1. Review the current list of JDBC MultiPools. Default values may vary, based on the configuration source you selected earlier.

Note: The wizard provides two views: a concise tabular view of all the defined components, and an individual view, in which each component is represented by a tab, and you view a particular component by selecting the corresponding tab. To toggle the display mode between table and tab formats, click Switch Display.

2. Add or modify entries as required by your configuration using the guidelines provided in the following table. (Fields marked with an asterisk are required.) To delete a JDBC MultiPool configuration, click in one of its fields and click Delete. When you finish updating your settings, click Next.

In this field . . . | Do the following . . .
--- | ---
Name* | Enter a valid JDBC MultiPool name: a string of characters that can include spaces. The name of the JDBC MultiPool must be unique among all configuration component names within the domain. The default value in this field is `new_JDBCMultiPool_``n`, where `n` specifies a numeric value that is used to differentiate among all default MultiPool names; the value of `n` for the first MultiPool is 1. The value is incremented by 1 for each MultiPool that is added.
Algorithm type | From the drop-down list, select an algorithm type for the MultiPool. Available algorithm types include the following: `Load-Balancing`—If this field is set to `Load-Balancing`, a MultiPool distributes connection requests evenly to its member pools. This algorithm executes the same failover behavior executed by the `High-Availability` algorithm. `High-Availability`—If this field is set to `High-Availability`, connection pools are set up as an ordered list. When an application requests a connection, the MultiPool attempts to obtain a connection from the first connection pool in the list. If it cannot obtain a valid connection, it tries the next connection pool in the list. The process is repeated until a valid connection is obtained, or until the list is exhausted, at which time an exception is thrown. The MultiPool proceeds to the next connection pool in the list only when there is a problem with the pool, for example the database is down or the pool is disabled. If all connections are busy, the MultiPool behaves as a single pool and throws an exception. (default)

## Related Topics

"Overview of MultiPools" in Programming WebLogic JDBC at http://e-docs.bea.com/wls/docs81/jdbc/intro.html#intro021

"How Do I: Create XA domains with MultiPools and an Oracle RAC Database?" at http://e-docs.bea.com/platform/docs81/confgwiz/examples.html

# Assigning JDBC Connection Pools to MultiPools

The Assign JDBC Connection Pools to MultiPools window prompts you to assign JDBC connection pools to the newly defined JDBC MultiPools. This window is displayed only if you define one or more JDBC connection pools and JDBC MultiPools.

#### To assign JDBC connection pools to the defined JDBC MultiPools:

1. In the JDBC MultiPool pane, select the JDBC MultiPool to which you want to assign JDBC connection pools.

The current assignments for the selected JDBC MultiPool are displayed in the left pane.

2. In the left pane, do one of the following:

- To assign a JDBC connection pool to the selected MultiPool, select the associated check box.
- To remove a JDBC connection pool from the selected MultiPool, clear the associated check box.

To select all connection pools in the list, choose Select All. To unselect all connection pools in the list, choose Unselect All.

The list of connection pools associated with each JDBC MultiPool is updated to reflect your changes.

3. Repeat steps 1 and 2 for each JDBC connection pool that you want to assign to a JDBC MultiPool. Keep in mind that you can assign a connection pool to more than one MultiPool.
4. Click Next to proceed to the next configuration window.

# Configuring JDBC Data Sources

A data source object enables a JDBC application to obtain a DBMS connection from a connection pool. Each data source object binds to the JNDI tree and points to a connection pool or MultiPool. Applications look up the data source on the JNDI tree and then request a connection from the data source.

Data source objects can be defined with support for global transactions (Tx Data Source). Such support is required for any applications in which distributed transactions are used.

The Configure JDBC Data Sources window prompts you to configure the data sources that are bound to the JNDI tree and assign a JDBC connection pool. This window is displayed only if you have defined at least one JDBC connection pool. This step is optional.

#### To configure JDBC data sources:

1. Review the current list of JDBC data sources. Default values may vary, based on the configuration source you selected earlier.

Note: The wizard provides two views: a concise tabular view of all the defined components, and an individual view, in which each component is represented by a tab, and you view a particular component by selecting the corresponding tab. To toggle the display mode between table and tab formats, click Switch Display.

2. Add or modify entries as required by your configuration using the guidelines provided in the following table. (Fields marked with an asterisk are required.) To delete a JDBC data source, click in one of its fields and click Delete. When you finish updating your settings, click Next.

In this field . . . | Do the following . . .
--- | ---
Name* | Enter a valid name for the JDBC data source: a string of characters that can include spaces. The JDBC data source name is used in the configuration file (`config.xml`) and in the WebLogic Server Administration Console. The default value in this field is `new_JDBCDataSource_``n` or `new_JDBCTxDataSource_``n`, where `n` specifies a numeric value that is used to differentiate among all default data sources; the value for the first data source is 1. The value is incremented by 1 for each data source that is added.
JNDI name* | Enter a valid JNDI pathname to which this data source is bound. When an application looks up a JNDI path, a `javax.sql.DataSource` instance corresponding to the data source is returned.
Pool name* | From the drop-down list, select an existing JDBC connection pool or the JDBC MultiPool to be associated with the data source. Applications get a connection from the underlying JDBC connection pool by looking up the data source on the JNDI tree and then requesting a connection from the data source.
Honor global transaction | To disable support for global transactions, clear the check box. The default setting is enabled. If global transactions are enabled, a Tx Data Source is created. If global transactions are disabled, a non-transactional data source is created.

## Related Topics

"Overview of Data Sources" in Programming WebLogic JDBC at http://e-docs.bea.com/wls/docs81/jdbc/intro.html#datasources

Tutorial: Creating a Custom Domain With Managed Servers, a Cluster, and Application Services

# Testing JDBC Connection Pools and Setting Up a JDBC Database

The Test JDBC Connection Pools and Setup JDBC Database window prompts you to test the JDBC connection pool configurations on the local machine. You can test any database supported by the JDBC drivers installed with WebLogic Platform, including: PointBase Universal Driver, Oracle Thin Driver, WebLogic jDriver for Microsoft SQL Server, and Sybase jConnect and jConnect2.

This step is optional.

Note: In most cases, when you are creating a domain that uses the PointBase database, you do not need to test the JDBC connection pools, or set up the JDBC database. For those cases when you do, such as for templates that use the WebLogic Server demo database (`jdbc:pointbase:server://localhost:9092/demo`), follow the steps described in this procedure. Examples of templates that use the WebLogic Server demo database are the WebLogic Server Examples Domain and the Avitek Medical Records Sample Domain.

#### To test a JDBC connection pool:

1. Select the connection pool from the list of Available JDBC Connection Pools.
2. If you want to capture test output in a log file, complete one of the following steps:

- Select Log File and manually enter the location of the log file.
- Click Browse, navigate to the name of the log file, and click Select log file.

By default, results are displayed in the Results area.

3. Click Test Connection to verify that the selected JDBC connection pool is working.

Note: Your database must be running to successfully test the JDBC connection.

4. If your template contains SQL files, go to Setting Up the JDBC Database Content to set up the database content. Otherwise, click Next to proceed to the next configuration window.

## Setting Up the JDBC Database Content

The Available SQL Files and Database Loading Options pane in the Test JDBC Connection Pools and Setup JDBC Database window prompts you to set up the database content used by the applications in the domain using pre-existing SQL or database loading files. A configuration template may contain a set of SQL files organized by database type. This pane is displayed only if the configuration template contains one or more SQL files.

This step is optional.

#### To set up the database content:

1. From the Available SQL Files and Database Loading Options list, select the file to be loaded.
2. Click Load Database.

The database is loaded, using the selected file, and the results are displayed in the Results pane. If you prefer to capture test output in a log file, select the Log File check box and manually enter the location of the log file or click Browse to navigate to the name of the desired log file.

3. Click Next to proceed to the next configuration window.

## Related Topics

Adding SQL Scripts Into Your Configuration Template