Before you begin
Make sure that the JDBC drivers that you want to use to create database connections are installed on all servers on which you want to deploy the data source. Some JDBC drivers are installed with WebLogic Server, including WebLogic-branded Data Direct JDBC drivers for DB2, Informix, MS SQL Server, and Sybase. For more information about working with JDBC drivers, see Using JDBC Drivers with WebLogic Server.
In WebLogic Server, you configure database connectivity by adding JDBC data sources to your WebLogic domain. A data source is a Java EE standard method of configuring connectivity to a database. Each WebLogic data source contains a pool of database connections. Applications look up the data source on the JNDI tree or in the local application context and then reserve a database connection with the getConnection method. Data sources and their connection pools provide connection management processes that help keep your system running efficiently.
To create a JDBC data source:
Name - Enter a
name for this JDBC data source. This name is used in the
configuration file (config.xml
) and throughout
the Administration Console whenever referring to this data
source.
JNDI Name - Enter the JNDI path to where this JDBC data source will be bound. Applications look up the data source on the JNDI tree by this name when reserving a connection.
Database Type - Select the DBMS of the database that you want to connect to. If your DBMS is not listed, select Other.
Click Next to continue.
Database Driver - Select the JDBC driver you want to use to connect to the database. The list includes common JDBC drivers for the selected DBMS.
Note: You must install JDBC drivers before you can use them to create database connections. Some JDBC drivers are installed with WebLogic Server, but many are not installed.
Supports Global Transactions - Select this check box (the default) to enable global transaction support in this data source. Clear this check box to disable (ignore) global transactions in this data source. In most cases, you should leave the option selected. See Configure Transaction Options for Generic Data Sources.
If you selected Supports Global Transactions, select an option for transaction processing: (available options vary depending on whether you select an XA driver or a non-XA driver)
This option is only available when you select an XA JDBC driver to make database connections.
This option is only available when you select a non-XA JDBC driver to make database connections.
This option is only available when you select a non-XA JDBC driver to make database connections.
This option is only available when you select a non-XA JDBC driver to make database connections.
For more information about transaction options, see JDBC Data Source Transaction Options.
Click Next to continue.
Service Name - This field is available only if you selected one of the available Oracle RAC Service-Instance connections drivers. Specify the service name of the database to which you want to connect. This must be the same for each data source in a given multi data source. For more information on configuring data sources to connect to Oracle RAC services, see Configuring Connections to Services on Oracle RAC Nodes.
Database Name - Enter the name of the database that you want to connect to. Exact database name requirements vary by JDBC driver and by DBMS.
Host Name - Enter the DNS name or IP address of the server that hosts the database. If you are creating an Oracle GridLink service-instance connection, this must be the same for each data source in a given multi data source.
Port - Enter the port on which the database server listens for connections requests.
Database User Name - Enter the database user account name that you want to use for each connection in the data source.
Password/Confirm Password - Enter the password for the database user account.
oracle.jdbc.DRCPConnectionClass - Optionally, enter the Database Resident Connection Pooling (DCRP) connection class if required by your environment.
Click Next to continue.
WebLogic attempts to create a connection from the Administration Server to the database. Results from the connection test are displayed at the top of the page. If the test is unsuccessful, you should correct any configuration errors and retry the test.
If the JDBC driver you selected is not installed on the Administration Server, you should click Next to skip this step.
Click Next to continue.