Microsoft SQL Server DB2 Data Types

9-84 Oracle Fusion Middleware Users Guide for Technology Adapters For IBM DB2, Default Schema refers to the current database user. Click Default Schema to select a different database user. The stored procedures in the Browse page are those that the database user created in the database specified as database in the JDBC Connection URL. The Adapter Configuration Wizard does not support changing to a different database. Select the stored procedure in the Stored Procedures dialog, as shown in Figure 9–43 . The arguments are shown in the Arguments tab. Click Search to find database stored procedures that the user created in the specified database. For example, d or D would both find the DEMO stored procedure. Clicking Show All reveals all of the procedures that the current user created in the specified database. Figure 9–43 The Stored Procedures Dialog You can view the source code of the stored procedure by clicking the Source tab, as shown in Figure 9–44 . Oracle JCA Adapter for Database 9-85 Figure 9–44 The Source Code of the Stored Procedure

9.7.2.2.3 IBM DB2 AS400

Table 9–15 lists the supported data types for IBM DB2 AS400 stored procedures: Distinct types are also supported for data types that are created using the CREATE DISTINCT TYPE statement. These data types work in the same way as they do in IBM DB2. Table 9–15 Data Types for IBM DB2 AS400 Stored Procedures SQL Data Type XML Schema Type BINARY BINARY LARGE OBJECT BINARY VARYING base64Binary CHARACTER CHARACTER LARGE OBJECT CHARACTER VARYING string DATE TIME TIMESTAMP dateTime DECIMAL NUMERIC decimal DOUBLE PRECISION double BIGINT long INTEGER int REAL float SMALLINT short 9-86 Oracle Fusion Middleware Users Guide for Technology Adapters Note that the IBM DB2 AS400 implementation is based on queries from catalog tables in the QSYS2 schema. The adapter tries to determine whether the QSYS2.SCHEMATA table exists. If it does, then the Adapter Configuration Wizard queries tables in the QSYS2 schema. Therefore, if your IBM DB2 AS400 database supports the QSYS2 schema, then the Adapter Configuration Wizard and the adapter run time should both work. Note that the Adapter Configuration Wizard checks the SYSCAT schema first, and then the QSYS2 schema. The adapter does not support the catalog tables in the SYSIBM schema.

9.7.2.2.4 MySQL

The Adapter Configuration Wizard can be used to access stored procedures on MySQL v5.6 or later using catalog tables in the INFORMATION_SCHEMA schema. Versions of MySQL before v5.6 lack a PARAMETERS table in the INFORMATION_SCHEMA schema. Without a PARAMETERS table, the MySQL database does not provide any information about the parameters of a stored procedure. It is therefore necessary to supply this information using a required property in the properties file. The Parameters property contains the signature of the stored procedure. The value of the Parameters property is a comma-delimited list of parameters, each of which has the following syntax Parameter ::= {IN | INOUT | OUT} Parameter_Name SQL_Datatype Note that all three elements of a parameter definition are required. Consider the following MySQL stored procedure: CREATE PROCEDURE demo IN x VARCHAR 10, INOUT y INT, OUT z CHAR 20 BEGIN ... END The Parameters property must be specified as shown in the following example: Parameters=IN x VARCHAR 10, INOUT y INT, OUT z CHAR 20 The generated XSD for the stored procedure is invalid unless the parameters are specified correctly in the parameters property. The following is a sample of a properties file for MySQL: ProductName=MySQL DriverClassName=com.mysql.jdbc.Driver ConnectionString=jdbc:mysql:host:portdatabase Username=username Password=password SchemaName=database ProcedureName=demo Parameters=IN x VARCHAR10,INOUT y INT,OUT z TEXT20 ServiceName=MySQLDemoService Property Description IsFunction Determines whether the API is a function or a procedure SchemaName The name of the database where the API is defined Parameters The parameters of the stored procedure Oracle JCA Adapter for Database 9-87 DatabaseConnection=mysql Table 9–16 lists the supported data types for MySQL stored procedures: Note: For MySQL, the SchemaName, Parameters, and IsFunction properties are all required properties. Table 9–16 Data Types for MySQL Stored Procedures SQL Data Type XML Schema Type BINARY BLOB LONGBLOB MEDIUMBLOB TINYBLOB VARBINARY base64Binary BOOLEAN boolean CHAR LONGTEXT MEDIUMTEXT TEXT TINYTEXT VARCHAR string DATE DATETIME TIMESTAMP dateTime DECIMAL NUMERIC REAL decimal DOUBLE double FLOAT float TINYINT byte TINYINT UNSIGNED unsigned_byte SMALLINT short SMALLINT UNSIGNED unsigned_short INTEGER INT MEDIUMINT int INTEGER UNSIGNED INT UNSIGNED MEDIUMINT UNSIGNED unsigned_int BIGINT long BIGINT UNSIGNED unsigned_long