BPEL_USEJPUB_drop.sql – Drops the schema objects.

Oracle JCA Adapter for Database 9-119 and any additional schema objects must then be reloaded into the database schema. After editing the SQL file, the signature of the wrapper procedure is as follows: TOPLEVELNEEDSWRAPPER B INTEGER DEFAULT 1, N NUMBER DEFAULT 0 For Boolean parameters, the default value for true is 1, and the default value for false is 0. As a final step, the XSD file generated for the wrapper must be edited. A special attribute must be added to elements representing parameters that now have default clauses. Add db:default=true to each element representing a parameter that now has a default clause. For example, element name=B … db:default=true … element name=N … db:default=true … This attribute is used at run time to indicate that if the element is missing from the instance XML, then the corresponding parameter must be omitted from the procedure call. The remaining attributes of these elements remain exactly the same.

9.8 Oracle Database Adapter Use Cases

This describes the Oracle Database Adapter and Oracle Database Adapter - stored procedures use cases. This section includes the following topics: ■ Section 9.8.1, Use Cases for Oracle Database Adapter ■ Section 9.8.2, Use Cases for Oracle Database Adapter - Stored Procedures

9.8.1 Use Cases for Oracle Database Adapter

To obtain Oracle Database Adapter use cases, access the Oracle SOA Sample Code site, and select the Adapters tab. Table 9–20 shows the Oracle Database Adapter samples that are provided with Oracle BPEL PM, and Mediator. Table 9–20 Oracle Database Adapter Use Cases Tutorial Name Description Delete Illustrates the outbound delete operation of the Oracle Database Adapter. An XML record is passed to the operation and the row in the database with the same primary key is deleted. File2Table Illustrates the use of an input a native CSV data file defined in a custom format. The input file is a purchase order, which the file adapter processes and publishes as an XML message to the FIle2Table BPEL process. The message is transformed to another purchase order format and routed to an invoke activity. Insert Illustrates the outbound insert operation of the Oracle Database Adapter. An XML record is passed to the operation and inserted into the database as relational data. In JDeveloper BPEL Designer, Merge Insert or Update is provided. InsertWithCatch Illustrates the extra steps based on the Insert tutorial needed to add fault handling to your BPEL process. 9-120 Oracle Fusion Middleware Users Guide for Technology Adapters JPublisherWrapper Illustrates a workaround for using PLSQL RECORD types. JPublisher is used to create a corresponding OBJECT type whose attributes match the fields of the RECORD, and conversion APIs that convert from RECORD to OBJECT and vice versa. JPublisher also generates a wrapper procedure or function that accepts the OBJECT and invokes the underlying method using the conversion APIs in both directions. The invoked methods must be installed in an Oracle database not Oracle Lite. MasterDetail Illustrates how to migrate data from one set of tables to another. The sample uses the Oracle Database Adapter to read data from one set of tables, process the data, and write it in to another set of database tables using the adapter. Merge Illustrates the outbound merge operation of the Oracle Database Adapter. An XML record is passed to the operation and a corresponding row in the database is either inserted or updated. PollingControlTableStrategy Illustrates an inbound polling operation to poll XML instances from the MOVIES table. When a new row is inserted into the MOVIES table, the polling operation raises it to Oracle BPEL PM. This strategy uses a control table to store the primary key of every row that has not yet been processed. With a natural join between the control table and the source table by primary key, polling against the control table is practically the same as polling against the source table directly. PollingLastReadIdStrategy Illustrates an inbound polling operation to poll XML instances from the MOVIES table. Whenever a new row is inserted into the MOVIES table, the polling operation raises it to Oracle BPEL PM. This strategy uses a helper table to remember a sequence value. PollingLastUpdatedStrategy Illustrates an inbound polling operation to poll XML instances from the MOVIES table. Whenever a new row is inserted into the MOVIES table, the polling operation raises it to Oracle BPEL PM. This strategy involves using a helper table to remember a last_updated value. PollingLogicalDeleteStrategy Illustrates an inbound polling operation to poll XML instances from the MOVIES table. Whenever a new row is inserted into the MOVIES table, the polling operation raises it to Oracle BPEL PM. This strategy involves updating a special field on each row processed, and updating the WHERE clause at run time to filter out processed rows. PureSQLPolling Illustrates how to poll a table based on a date field. PureSQLSelect Illustrates how to bypass the JDeveloper BPEL Designer WHERE-clause builder to specify arbitrarily complex SQL strings for SELECT operations. QueryByExample Illustrates the outbound queryByExample operation of the Oracle Database Adapter. A SELECT SQL query is built dynamically based on fields set in an example XML record, and any matching records are returned. RefCursors Illustrates how to use a REF CURSOR with a strongly typed or weakly typed XSD. You can use the Adapter Configuration Wizard to create a strongly typed XSD for a row set returned by an Oracle Database stored procedure or function REF CURSOR variable. For more information, see Section 9.3.3, Row Set Support Using a Strongly or Weakly Typed XSD . ResultSetConverter Illustrates a workaround for using a REF CURSOR. The solution involves the use of a Java stored procedure to convert the corresponding java.sql.ResultSet into a collection either VARRAY or NESTED TABLE of OBJECTs. Table 9–20 Cont. Oracle Database Adapter Use Cases Tutorial Name Description Oracle JCA Adapter for Database 9-121 See Table 9–3 for the structure of the MOVIES table, which is used for many of the use cases. The readme.txt files that are included with most of the samples provide instructions.

9.8.2 Use Cases for Oracle Database Adapter - Stored Procedures