Using Top-Level Standalone APIs

Oracle JCA Adapter for Database 9-73

3. In the Service Name field, enter a service name, and then click Next. The Service

Connection page is displayed. You associate a connection with the service, as shown in Figure 9–31 . A database connection is required to configure the adapter service. Select an existing connection from the list or create a new connection. Figure 9–31 Setting the Database Connection in the Adapter Configuration Wizard

4. Click Next. The Operation Type page is displayed.

5. For the Operation Type, select Call a Stored Procedure or Function, as shown in

Figure 9–32 . 9-74 Oracle Fusion Middleware Users Guide for Technology Adapters Figure 9–32 Calling a Stored Procedure or Function in the Adapter Configuration Wizard

6. Click Next. The Specify Stored Procedure page is displayed, as shown in

Figure 9–33 . This is where you specify a stored procedure or function. Figure 9–33 The Specify Stored Procedure Page 7. Next, you select the schema and procedure or function. You can select a schema from the list or select Default Schema, in which case the schema associated with the connection is used. If you know the procedure name, enter it in the Procedure field. If the procedure is defined inside a package, then you must include the package name, as in EMPLOYEE.GET_NAME. Oracle JCA Adapter for Database 9-75 If you do not know the schema and procedure names, click Browse to access the Stored Procedures window, as shown in Figure 9–34 . Figure 9–34 Searching for a Procedure or Function Select a schema from the list or select Default Schema. A list of the available procedures is displayed in the left window. To search for a particular API in a long list of APIs, enter search criteria in the Search field. For example, to find all APIs that begin with XX, enter XX and click the Search button. Clicking the Show All button displays all available APIs. Figure 9–35 shows how you can select the FACTORIAL function. The Arguments tab displays the parameters of the function, including their names, type, mode IN, INOUT or OUT and the numeric position of the parameter in the definition of the procedure. The return value of a function has no name and is always an OUT parameter at position zero 0. 9-76 Oracle Fusion Middleware Users Guide for Technology Adapters Figure 9–35 Viewing the Arguments of a Selected Procedure Figure 9–36 shows how the Source tab displays the code that implements the function. Text that matches the name of the function is highlighted. Figure 9–36 Viewing the Source Code of a Selected Procedure

8. Click OK after selecting a procedure or function. Information about the API is

displayed, as shown in Figure 9–37 . Click Back or Browse to make revisions. Oracle JCA Adapter for Database 9-77 Figure 9–37 Viewing Procedure or Function Details in the Adapter Configuration Wizard

9. Click Next. If the stored procedure or function has an output parameter of type

row set REF CURSOR on Oracle Database, as Figure 9–38 shows, you can define a strongly or weakly typed XSD for this ref cursor. Figure 9–38 Viewing Procedure or Function Details in the Adapter Configuration Wizard: Row Set Type For more information, see: ■ Section 9.7.7.1, Row Set Support Using a Strongly Typed XSD 9-78 Oracle Fusion Middleware Users Guide for Technology Adapters ■ Section 9.7.7.2, Row Set Support Using a Weakly Typed XSD

10. Click Next. The Advanced Options page is displayed, as shown in

Figure 9–39 . Enter any advanced options, such as the JDBC QueryTimeout value. Other options include retry parameters, such as the number of retry attempts and the interval between them. Figure 9–39 The Advanced Options Page

11. After specifying all options, click Next, and then click Finish to complete the

Adapter Configuration Wizard. When you have finished using the Adapter Configuration Wizard, three files are added to the existing project: ■ servicename .wsdl for example, Factorial.wsdl ■ service_name_db .jca for example, Factorial_db.jca ■ schema_package_procedurename .xsd for example, SCOTT_ FACTORIAL.xsd

9.7.1.2 Using Packaged APIs and Overloading

Using APIs defined in packages is similar to using standalone APIs. The only difference is that you can expand the package name to see a list of all the APIs defined within the package, as shown in Figure 9–40 . APIs that have the same name but different parameters are called overloaded APIs. As shown in Figure 9–40 , the package called PACKAGE has two overloaded procedures called OVERLOAD. Oracle JCA Adapter for Database 9-79 Figure 9–40 A Package with Two Overloaded Procedures As Figure 9–41 shows, the code for the entire PLSQL package is displayed, regardless of which API from the package is selected when you view the Source tab. Text that matches the name of the procedure is highlighted. Figure 9–41 Viewing the Source Code of an Overloaded Procedure After you select a procedure or function and click OK, information about the API is displayed, as shown in Figure 9–42 . The schema, procedure name, and a list of arguments are displayed. Note how the procedure name is qualified with the name of the package PACKAGE.OVERLOAD. Click Back or Browse to make revisions, or 9-80 Oracle Fusion Middleware Users Guide for Technology Adapters Next . Enter values for any of the advanced options. Click Next followed by Finish to conclude. Figure 9–42 Viewing Procedure or Function Details in the Adapter Configuration Wizard When you have finished using the Adapter Configuration Wizard, the following files are added to the existing project: ■ Overload.wsdl, Overload_db.jca ■ SCOTT_PACKAGE_OVERLOAD_2.xsd. The _2 appended after the name of the procedure in the XSD filename differentiates the overloaded APIs. Numeric indexes are used to differentiate between overloaded APIs.

9.7.2 Supported Third-Party Databases

For stored procedures the following databases are supported: Oracle, DB2, Informix Dynamic Server, MySQL, Microsoft SQL Server, and Sybase Adaptive Server Enterprise. Contact support for specific versions that have been certified. If your particular version is more recent than one mentioned here it is probably supported. For more information on Oracle JCA Adapters support for third-party JDBC drivers and databases, see Section 9.6, JDBC Driver and Database Connection Configuration . This section includes the following topics: ■ Section 9.7.2.1, Terms Used. ■ Section 9.7.2.2, Supported Third-Party Databases ■ Section 9.7.2.3, Creating Database Connections