Skip navigation.
Downloads | Product Documentation | Support

Administration Console Online Help

# JDBC

[Attributes and Console Screen Reference for JDBC]

In the JDBC area of the Administration Console, you can configure and monitor JDBC components, including connection pools, MultiPools, and data sources. The following sections provide guidelines for configuring and managing database connectivity through the JDBC components for both local and distributed transactions:

- Creating and Deploying JDBC Components—Connection Pools, MultiPools, and Data Sources
- Overview of JDBC Administration

# Creating and Deploying JDBC Components—Connection Pools, MultiPools, and Data Sources

Using the Administration Console, you create the JDBC components—connection pools, data sources, and MultiPools—by specifying attributes and database properties and then deploy them to servers and clusters by selecting targets.

Figure 111-1 JDBC Components in WebLogic Server

First you create the connection pools (and optionally, MultiPools) and deploy them to servers and clusters, then you create the data sourceswhich are bound to the JNDI tree, and deploy the data sources to the same servers and clusters. When you create a data source object, you specify a connection pool or MultiPool as one of the data source attributes. This associates that data source with one specific connection pool or MultiPool ("pool").

When you target (deploy) data sources and connection pools, you should target the data source and its related connection pool to the same servers and clusters. Some common scenarios are as follows:

- In a single server configuration, assign each data source and its associated connection pool or MultiPool to the server.
- In a configuration with an administration server and managed servers, target the data source and associated connection pool to the servers on which they will be used.
- In a cluster, assign the data source and the associated connection pool or MultiPool to the cluster, not to individual servers in the cluster.

You can target data source/connection pool combinations to more than one server or cluster, but they must be targeted in combination. For example, you cannot target a data source to Managed Server A if its associated connection pool is assigned only to Managed Server B.

### Related Information

- JDBC Connection Pools
- Creating and Configuring a JDBC Connection Pool
- JDBC DataSources
- Creating and Configuring a JDBC Data Source
- JDBC MultiPools
- Creating and Configuring a JDBC MultiPool

## JDBC Objects in a Cluster

WebLogic Server allows you to cluster JDBC objects, including data sources, connection pools, and MultiPools, to improve the availability of cluster-hosted applications. Each JDBC object you configure for your cluster must exist on each managed server in the cluster—when you configure the JDBC objects, target them to the cluster.

For information about JDBC objects in a clustered environment, see "JDBC Connections" in Using WebLogic Server Clusters.

## Application Scoped JDBC Objects

See Application-Scoped JDBC Data Sources and Connection Pools.

## JDBC Configuration Guidelines

To set up JDBC connectivity, you configure connection pools, data sources (always recommended, but optional in some cases), and MultiPools (optional) by defining attributes in the Administration Console or, for dynamic connection pools, in application code or at the command line.

There are three types of transaction scenarios:

- Local transactions—non-distributed transactions
- Distributed transactions using an XA Driver—distributed transactions with multiple participants that use two-phase commit
- Distributed transactions using a non-XA Driver—transactions with a single resource manager and single database instance that emulate two-phase commit

You configure data sources, connection pools, and MultiPools according to the way transactions are handled in your system. The following table summarizes how to configure these objects for use in the three transaction scenarios:

Table 111-2 Summary of JDBC Configuration Guidelines

Description/Object | Local Transactions | Distributed Transactions XA Driver | Distributed Transactions Non-XA Driver
--- | --- | --- | ---
JDBC driver | WebLogic jDriver for Oracle . Compliant third-party drivers. | WebLogic jDriver for Oracle/XA. XA-compliant third-party drivers. | WebLogic jDriver for Oracle Compliant third-party drivers.
Data Source | Data source object recommended. (If there is no data source, use the JDBC API.) | Requires data source with Honor Global Transactions selected (Tx Data Source in the `config.xml` file). | Requires data source with Honor Global Transactions selected (Tx Data Source in the `config.xml` file). Select Emulate Two-Phase Commit for non-XA Driver (set `enable two-phase commit=true)` See Configuring Non-XA JDBC Drivers for Distributed Transactions and Emulating Two-Phase Commit
Connection Pool | Requires data source object when configuring in the Administration Console. | Requires data source with Honor Global Transactions selected (Tx Data Source in the `config.xml` file). | Requires data source with Honor Global Transactions selected (Tx Data Source in the `config.xml` file).
MultiPool | Connection pool and data source required. | Supported with restrictions. | Supported with restrictions.

Note: For distributed transactions, use an XA-compliant driver, such as the WebLogic jDriver for Oracle/XA, which is the XA compliant version of the WebLogic jDriver for Oracle.

# Overview of JDBC Administration

The Administration Console provides an interface to the tools that allow you to configure and manage WebLogic Server features, including JDBC (Java database connectivity). For most JDBC administrative functions, which include creating, managing and monitoring connectivity, systems administrators use the Administration Console or the command-line interface. Application developers may want to use the JDBC API or the WebLogic Management API.

Frequently performed tasks to set and manage connectivity include:

- Defining the attributes that govern JDBC connectivity between WebLogic Server and your database management system
- Monitoring established connectivity
- Tuning JDBC Objects

## About the Administration Console

Your primary way to set and manage JDBC connectivity is through the Administration Console. In addition to setting connectivity, the Administration Console allows you to manage and monitor established connectivity.

You can also create connection pools, data sources, and MultiPools with the administration command line or in application code. For details, see Commands for Managing JDBC Connection Pools in the WebLogic Server Command Reference and see Programming WebLogic JDBC.

## Related Information

The JDBC drivers, used in local and distributed transactions, interface with many WebLogic Server components and information appears in several documents. For example, information about JDBC drivers is included in the documentation sets for JDBC, JTA, and WebLogic jDrivers.

The following sections list Related Topics resources for JDBC, JTA, and Administration:

### Administration and Management

- For a complete list of the JDBC attributes used in the configuration file (`config.xml`), see the WebLogic Server Configuration Reference Guide
- For information about using the command-line interface, see Commands for Managing JDBC Connection Pools in the WebLogic Server Command Reference
- For information about administering a WebLogic Server domain using the JDBC API and the JMX API for configuring JDBC objects in WebLogic Server, see Programming WebLogic JDBC

### JDBC and WebLogic jDrivers

The following documentation is written primarily for application developers. Systems Administrators may want to read the introductory material as a supplement to the material in this document.

- For information about using third-party JDBC drivers, see "Using Third-Party Drivers with Weblogic Server" in Programming WebLogic JDBC.
- For information about using the WebLogic jDriver for Oracle, see Configuring and Using WebLogic jDriver for Oracle.

### Transactions (JTA)

- For information about managing JTA, see JTA.
- For information about using third-party drivers in distributed transactions, see "Using Third-Party JDBC XA Drivers with WebLogic Server in Programming WebLogic JTA.

The following documentation is written primarily for application developers. Systems Administrators may want to read the following as supplements to the material in this section.

- For information about distributed transactions, see Programming WebLogic JTA.
- For information about using the WebLogic jDriver for Oracle/XA, see Using WebLogic jDriver for Oracle/XA in Distributed Transactions in Using WebLogic jDriver for Oracle.