9 Using Oracle Databases with WebLogic Server

WebLogic Server integrates with specific features of the Oracle database to provide some advanced functionality.

WebLogic JDBC Features for Oracle Database 12.1

Learn about Oracle database features supported with various combinations of WebLogic Server, 11g and 12c JDBC drivers, and 11g and 12.1 versions of Oracle Database.

Table 9-1 Oracle Database 12.1 Feature Support

Feature WebLogic Server 10.3.6/12.1.x with 11g drivers and Oracle Database 11gR2 WebLogic Server 10.3.6/12.1.x with 11g drivers and Oracle Database 12c WebLogic Server 10.3.6/12.1.1 with 12c and later drivers and Oracle Database 11gR2 WebLogic Server 12.1.2 and later with 12c and later drivers and Oracle Database 11gR2 WebLogic Server 10.3.6/12.1.1 with 12c and later drivers and Oracle Database 12c WebLogic Server 12.1.2 and later with 12c and later drivers with Oracle Database 12c

JDBC Replay Driver (read/write)

No

No

No

No

Yes (Read/Write with Active GridLink only, no XA transactions)

Yes (Read/Write with Active GridLink and Generic data source, no XA transactions)

Pluggable Database (PDB)

No

Yes (Except Set Container)

No

No

Yes

Yes

Dynamic switching between PDBs

No

No

No

No

No

Yes (no XA)

Database Resident Connection Pooling(DRCP)

No

No

No

Yes

No

Yes

Oracle Notification Service (ONS) auto configuration

No

No

No

No

No

Yes (Active GridLink only)

Global Data Services (GDS)

No

Yes (Active GridLink only)

No

No

Yes (Active GridLink only)

Yes (Active GridLink only)

JDBC 4.1 (using ojdbc7.jar files and JDK 7)

No

No

Yes

Yes

Yes

Yes

WebLogic JDBC features for Oracle Database 12.1 are:

JDBC 4.1 Support for JDK 7

WebLogic Server supports the JDBC 4.1 specification when the environment is using JDK 7 and the JDBC driver is JDBC 4.1 compliant. To use new JDBC 4.1 methods, you must use the ojdbc7.jar. See JDBC™ 4.1 Specification.

Note:

WebLogic Server currently does not support the java.sql.driver interfaces required to use the Java SE 8 getParentLogger method. See http://docs.oracle.com/javase/8/docs/api/index.html?java/sql/Driver.html.

JDK 7 also brings support for minor changes in Rowset 1.1 defined at http://jcp.org/aboutJava/communityprocess/maintenance/jsr114/114MR2approved.pdf. The WebLogic Server implementation of the new RowSetFactory is called weblogic.jdbc.rowset.JdbcRowSetFactory.

JDBC Replay Driver Support

JDBC Replay Driver (also referred to as Replay) is a general purpose, application-independent infrastructure for Active GridLink and Generic data sources that enables the recovery of work from an application perspective and masks many system, communication, and hardware failures. See JDBC Replay Driver.

Database Resident Connection Pooling Support

Database Resident Connection Pooling (DRCP) is an Oracle database server feature that provides the ability to share connections among multiple connection pools that can span across mid-tier systems. See Database Resident Connection Pooling.

Container Database with Pluggable Databases

Container Database (CDB) is an Oracle Database feature that minimizes the overhead of having many of databases by consolidating them into a single database with multiple Pluggable Databases (PDB) in a single CDB. See Container Database with Pluggable Databases.

Global Data Services Support

Global Data Services (GDS) is an Oracle Database feature that provides automated load balancing, fault tolerance and resource utilization in a distributed database environment. See Global Database Services.

Automatic ONS Listeners

If you are using Oracle Database 12c with WebLogic Server version 12.1.2 or later, you are no longer required to provide the ONS Listener list as part of an Active GridLink data source configuration. The ONS list is automatically provided from the database to the driver. See Enabling FAN Events.

WebLogic JDBC Features for Oracle Database 12.2

WebLogic JDBC provides several features that specifically require the use of Oracle Database 12.2.x. Learn about supported features with various combinations of WebLogic Server releases and Oracle Database 12.2.x release.

Table 9-2 Oracle Database 12.2 Feature Support

Feature Description WebLogic Server Introduced Database Releases

JDBC 4.2

See JDBC 4.2 Interfaces

12.1.3

12.1.0.1

Service Switching

See Service Switching

12.2.1

12.2

JDBC Replay Driver

See Database 12.2 JDBC Replay Driver

12.2.1

12.2

UCP MT Shared Pool support

See Universal Connection Pool Multi Tenant Shared Pool support

12.2.1.1.0

12.2

Gradual Draining

During planned maintenance, it is desirable to gradually drain connections instead of closing them all immediately. This prevents uneven performance by the application. See Gradual Draining

12.2.1.2.0

12.1 with 12.2 enhancements

AGL Support for URL with @alias or @ldap

See AGL Support for URL with @alias or @ldap

12.2.1.2.0

12.2

Data Source Shared Pooling

Shared pooling feature provides the ability for multiple data source definitions to share an underlying connection pool. See Using Shared Pooling Data Sources

12.2.1.3.0

12.2

Transaction Guard Integration

Transaction Guard provides a generic infrastructure for applications to use for at-most-once execution during planned and unplanned outages and duplicate submissions. See Using Transaction Guard in Developing JTA Applications for Oracle WebLogic Server.

12.2.1.3.0

12.1.0.2

WebLogic JDBC features for Oracle Database 12.2 are:

JDBC 4.2 Interfaces

JDK 8 has new API's for JDBC 4.2 that are supported for any database driver that is JDBC 4.2 compliant. The first Oracle driver to support JDK 8 and JDBC 4.2 is 12.2.0.1.

The following are the features introduced in JDBC 4.2 java.sql and javax.sql.

  • Added JDBCType enum and SQLType interface

  • Support for REF CURSORS in CallableStatement

  • DatabaseMetaData methods to return maximum Logical LOB size and if REF CURSORS are supported

  • Added support for large update counts

The JDBC 4.2 API changes are documented at https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/jdbc_42.html.

Database 12.2 JDBC Replay Driver

The JDBC Replay Driver is new in Oracle Database 12.2. The name is oracle.jdbc.replay.OracleXADataSourceImpl. If the WebLogic Server is run on a driver earlier than 12.2, an error will be thrown indicating that the class cannot be loaded.

If the data source is running with the JDBC Replay Driver from database 12.2, the test table name is validated as follows:

  • If SQL ISVALID or SQL PINGDATABASE, no change.

  • If a table name (which is converted to select count(*) from tablename) or SQL SELECT is specified, it is converted to SQL ISVALID.

  • Any other value (DML or DDL) will cause an exception to be thrown and the data source will not deploy.

Note:

12.2 JDBC Replay Driver does not support replay with global transactions, it supports local transactions on an XA connection.
 

AGL Support for URL with @alias or @ldap

This feature allows for using an alias or an LDAP connection in the AGL URL.

The alias format is jdbc:oracle:thin:@alias where "alias" is an alias defined in a tnsnames.ora file. 

See LDAP Syntax.

To use an alias, you need to you need to perform the following steps:

  1. Specify the system property -Doracle.net.tns_admin=tns_directory, where tns_directory, is the directory location of the tnsnames.ora file.

  2. Create or modify a tnsnames.ora file in the directory location specified by tns_directory.

    The entry has the form: alias=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=host)(PORT=port))(CONNECT_DATA=(SERVICE_NAME=service)))

    where host is URL of a database listener, port is the port a database listener, and service is the service name of the database you would like to connect to.
  3. Use the alias in the data source definition URL by replacing the connection string with the alias.

    For example, change the URL attribute in the Connection Pool tab of the Administrative Console to jdbc:oracle:thin:@alias.