Specifying the Message Selector when Defining an Activation Spec Compatibility and Migration

8-58 Oracle Fusion Middleware Users Guide for Technology Adapters 9 Oracle JCA Adapter for Database 9-1 9 Oracle JCA Adapter for Database This chapter describes the Oracle JCA Adapter for Database Oracle Database Adapter, which works in conjunction with Oracle BPEL Process Manager and Oracle Mediator Mediator. This chapter also includes support for stored procedures and functions for Oracle databases only. In addition, it contains references to use cases for the Oracle Database Adapter and for stored procedures. This chapter includes the following topics: ■ Section 9.1, Introduction to the Oracle Database Adapter ■ Section 9.2, Complete Walkthrough of the Adapter Configuration Wizard ■ Section 9.3, Oracle Database Adapter Features ■ Section 9.4, Oracle Database Adapter Concepts ■ Section 9.5, Deployment ■ Section 9.6, JDBC Driver and Database Connection Configuration ■ Section 9.7, Stored Procedure and Function Support ■ Section 9.8, Oracle Database Adapter Use Cases

9.1 Introduction to the Oracle Database Adapter

The Oracle Database Adapter enables a BPEL process to communicate with Oracle databases or third party databases through JDBC. The Oracle Database Adapter service is defined within a BPEL process partner link by using the Adapter Configuration Wizard of Oracle BPEL Process Manager Oracle BPEL PM. This section includes the following topics: ■ Section 9.1.1, Functional Overview ■ Section 9.1.2, Design Overview

9.1.1 Functional Overview

The Oracle Database Adapter enables Oracle SOA Suite and Oracle Fusion Middleware to communicate with database end points. These include Oracle database servers and any relational databases that comply with ANSI SQL and provide JDBC drivers. The principle of the tables and views in the Oracle Database Adapter is to expose to SOA tables and SQL as transparently and non-intrusively as possible. From an integration standpoint, tables and SQL are what relational database products have in common, so a generic solution focused on what is standard has the greatest reach. In 9-2 Oracle Fusion Middleware Users Guide for Technology Adapters exposing databases to SOA, it is also about combining the technologies of SQL and XML, the former an ideal language for querying information, the latter an ideal format for transporting and representing information. While stored procedure support is less standard across databases, Oracle Database Adapter provides support for stored procedures as the guide describes. The Oracle Database Adapter is a JCA 1.5 connector, which runs on the Oracle Application Server. It relies on an underlying JDBC connectordriver to enact the database communication. In contrast to JDBC, it is non-programmatic. The interaction series of SELECT, UPDATE, INSERT is loosely modeled using the Adapter Configuration Wizard. The inputsoutputs are XML, most easily seen as input parameters and result sets converted to XML. These XML inputs and outputs allow the Oracle Database Adapter services to be plugged into Oracle Fusion Middleware. To access an existing relational schema, you must create a new application and an SOA project to use the Adapter Configuration Wizard to perform the following: ■ Import a relational schema one or more related tables and map it as an XML schema XSD For more information, see Section 9.4.1, Relational-to-XML Mapping. ■ Abstract SQL operations such as SELECT, INSERT, and UPDATE as Web services For more information, see Section 9.4.2, SQL Operations as Web Services. ■ Have database events initiate an Oracle Fusion Middleware process. The Oracle Database Adapter can currently be used only within the context of an SOA process as Section 9.1.1.1, Oracle Database Adapter Integration with Oracle BPEL PM describes. Although Oracle Streams Advanced Queuing Oracle AQ is an Oracle Database feature, you use the separate, specialized Oracle JCA Adapter for AQ to integrate with Oracle AQ. For more information, see Chapter 7, Oracle JCA Adapter for AQ . For non-relational and legacy systems with a few exceptions such as DB2 on AS400, application and mainframe adapters are available. For more information about application and mainframe adapters, see: ■ Section 1.2.2, Legacy Adapters ■ Section 1.2.3, Packaged-Application Adapters ■ Section 1.2.4, Oracle Adapter for Oracle Applications For more information on the Oracle Database Adapter, see: ■ Section 9.3, Oracle Database Adapter Features ■ Section 9.4, Oracle Database Adapter Concepts ■ Section 9.2, Complete Walkthrough of the Adapter Configuration Wizard

9.1.1.1 Oracle Database Adapter Integration with Oracle BPEL PM

When the Oracle Database Adapter is used to poll for database events usually an INSERT operation on an input table and initiate a process, in a Mediator component or an SOA composite it is called an exposed service. In Oracle BPEL process it is a partner link tied to a Receive activity. The expression inbound from database into SOA is commonly used. When the Oracle Database Adapter is used to invoke a one-time DML statement such as INSERT or SELECT, in a Mediator component or an SOA composite, it is called a Oracle JCA Adapter for Database 9-3 service reference. In Oracle BPEL process, it is a partner link tied to an Invoke activity. The expression outbound from SOA out to the database is used.

9.1.2 Design Overview

Figure 9–1 shows how the Oracle Database Adapter interacts with the various design-time and deployment artifacts. Figure 9–1 How the Oracle Database Adapter Works The Oracle Database Adapter is a JCA 1.5 connector, which is deployed to the application server during installation. The Oracle Database Adapter consists of multiple instances; each instance represents a connection to a database end point. Different SOA processes may point to the same adapter instance database, while different service endpoints in a SOA process may point to different adapter instances databases. Because each adapter instance points to a single database, there is a one-to-one correspondence from adapter instances to application server data sources. Out of the box there is a single Oracle Database Adapter instance named eisDBSOADemo, which points to the data source jdbcSOADataSource. The list of adapter instances is stored in a deployment descriptor file, weblogic-ra.xml on Oracle WebLogic Server. It is inside of DbAdapter.rar, which contains also the Java class files in DBAdapter.jar. Configuring an Oracle Database Adapter instance is more about creating the underlying data source: getting the correct JDBC driver and connection URL. For more information, see Section 9.6, JDBC Driver and Database Connection Configuration. JCA Binding Component Data Source Database SCA Runtime JDeveloper SOA Studio JDeveloper Project File .JPR .properties Application Server JCA JNDI MyDBConnection1 eisDBSOADemo Fabric or_mappings.xml · WSDL · _db.JCA · XSD Deployment weblogic-ra.xml DBAdapter composite.xml Adapter Configuration Wizard SOA Artifacts Design Time sessions.xml jdbcSOADemo JDBC