WebSphere Adapter for JDBC
To generate business objects, you select database object nodes. Then the enterprise service discovery wizard generates business objects for the objects of the selected nodes.
You can select multiple database object nodes. For each table or view type node you select when Define ASI property is set to true, the enterprise service discovery wizard requests the object-level parameters for StatusColumnName and StatusValue application-specific information, and the verb application-specific information association.
For StatusColumnName, you are presented with a list of business object attributes, and you can select one from the list. You need to type a value for the StatusValue. These values are set in the business object level application-specific information.
In addition, you can choose to associate stored procedures to the business objects. A list of all the supported StoredProcedureType values is presented so you can select the ones you want to configure. For more information, see StoredProcedureType under "Stored Procedure Definition." After you select some values, the enterprise service discovery wizard displays corresponding verb application-specific information property groups for you to configure.
For example, if you want to configure only the BeforeCreateSP and AfterUpdateSP types, you select these verb application-specific information values for the StoredProcedureType. Then two verb application-specific information property groups are displayed, one for each value.
Each property group contains the properties Schema and StoredProcedure which you use to select the appropriate schema name and stored procedure name. The Schema property lists the schemas available in the database. You can filter schemas by using the SPSchemaNameFilter property. You need to select at least one schema from the list of schemas, then the StoredProcedure property provides a list of stored procedures available under that schema.
To facilitate selecting stored procedures, for each StoredProcedure property, an SPNameFilter property is provided to narrow the list of stored procedures. Two filter mechanisms are provided: Start With and Wildcard. The supported wildcards are * and ?. When the SPNameFilter property is not set, all stored procedures under the schema are displayed.
Property | Type | Description |
---|---|---|
SPSchemaNameFilter | String | Text used to filter schemas. The Schema property must be set. If the SPSchemaNameFilter property is not set, all of the schemas in the database are displayed. |
SPNameFilter | String | Text used to filter stored procedures under a schema. StoredProcedure property must be set. Two filter mechanisms are supported: Start With and Wildcard. If the SPNameFilter property is not set, all stored procedures under the schema are displayed. |
Filter criterion | A*B?d |
---|---|
Matched string | AdsfBnD |
Matched string | AsdfsdfsdfBwd |
Matched string | A234dsfB6d |
For each stored procedure assigned, a list of the stored procedure’s input and output parameters is presented. Each parameter has a list of the business object’s attributes. The parameter’s type is listed in the property’s description, such as IP, OP, or IO. You may select one business object attribute for each stored procedure parameter. All of the stored procedure types that have a stored procedure assigned are added to the verb application-specific information of the business object, for example, CreateSP and UpdateSP. For more information, see "Verb application-specific information."
You can remove any selected application-specific information from the StoredProcedureType property. All of the corresponding verb application-specific information property groups are also removed.
When you associate a stored procedure with a business object that is generated from a table or view, and if the stored procedure is a function, a value will be returned from this stored procedure. One ReturnValue application-specific information value will be added to the verb application-specific information. The existence of this application-specific information implies that it is a function call and not a procedure call, because a value is being retuned by the function.
If the value of this application-specific information is RS, it implies that the returned value is a result set and that this result set will be used to create the N-cardinality container corresponding to this business object. But if the value of this application-specific information is a business object attribute name, the returned value will be assigned to that particular attribute in the business object.
To generate a business object from a stored procedure, which is called a stored procedure business object, you need to set dummy values for the stored procedure input parameters. Then, enterprise service discovery can run this stored procedures to obtain the maximum number of result sets returned and to be able to obtain metadata of these result sets to generate child business objects accordingly.
If the selected stored procedure takes in some complex data types, such as Struct, Array and ResultSet, as input/output parameters or return values, then the wizard queries you for some necessary information. If the parameter is a complex type, you need to select ResultSet/Struct/Array from the property SPComplexParameterType to specify this parameter's data type. In the case of Struct or Array, you also must provide the name of the corresponding user-defined type name in the property SPComplexParameterTypeName.
For example, if you create one Struct object named Struct_TEMP in the database, and you set the type as one input parameter, then you need to set the value of this property to Struct_TEMP. Only by obtaining this type name can enterprise service discovery get its metadata to generate a corresponding child business object. If the stored procedure returns ResultSet, you need to set the number of result sets returned from this stored procedure in the property MaxNumberOfResultSets. This value represents the maximum number of returned result sets that will be handled by the runtime.
For stored procedure business objects, enterprise service discovery supports nested structs and arrays, and can support any number of layers of nested hierarchy. Enterprise service discovery can generate corresponding child business objects for all of these nested structs and arrays. The Adapter for JDBC runtime can also support nested structs and arrays.
Property | Type | Description |
---|---|---|
SPComplexParameter Type | String | Value can be Struct, Array or ResultSet |
SPComplexParameterTypeName | String | The name of the user-defined type. This property is required when the value of SPComplexParameterType is Struct or Array. |
MaxNumberOfResultSets | Integer | The maximum number of returned result sets to be handled by the Adapter for JDBC runtime. Enterprise service discovery also creates this number of business objects. |
If the QueryBO property is selected, the enterprise service discovery wizard asks you for some information. Use the QueryBOName to specify the name for this query business object. Use the SelectStatement property to enter one select statement. When you type the select statement, enterprise service discovery automatically detects the number of parameters in its where clause. When it detects the occurrence of one parameter, it displays one corresponding property group for you to specify the data type and dummy value for this parameter. When you remove one parameter from the select statement's where clause, enterprise service discovery detects this removal, removes all property groups, and recreates necessary property groups for the remaining parameters.
Every such property group includes two properties: WhereParameterType and WhereParameterValue. WhereParameterType has a list of all supported data types. You can select one data type to indicate the actual data type of this parameter in the database. After selecting a data type for this parameter, you can enter one dummy value into the WhereParameterValue property. This value is used to run the select statement.
select * from customer where id=? and age=?enterprise service discovery knows the number of parameters in its where clause is two. Then the wizard displays two property groups for the user to set data types and dummy values for these two parameters. For the first parameter, set the WhereParameterType property to string and set the WhereParameterValue to Mike. For the second parameter, set the WhereParameterType property to int and set the WhereParameterValue to 27. Enterprise service discovery will run this select statement to get the returned result set.
After obtaining the result set, enterprise service discovery will analyze its metadata to obtain the column name and column type of all columns. For each column of the returned result set, the wizard will generate one corresponding attribute in QueryBO. For each parameter in the where clause, enterprise service discovery will also generate one corresponding attribute in QueryBO. QueryBO generates one attribute named jdbcwhereclause. Enterprise service discovery sets the where clause as this attribute's default value. This attribute is used to set one dynamic where clause in runtime to replace the default where clause.
Property | Type | Description |
---|---|---|
QueryBOName | String | Name of the query business object. |
SelectStatement | String | The user-specified select statement. |
WhereParameterType | String | The data type of one parameter. Selected from a list of supported data types. |
WhereParameterValue | String | The dummy value of one parameter. Enterprise service discovery uses this value to run the select statement. |
Bidirectional support is provided for string constants only in the SelectStatement property, because a SQL statement can be complex and providing bidirectional support could cause its corruption.
After you have selected database objects, you need to set values for the Metadata Selection properties. The enterprise service discovery wizard queries for these properties. For details about these properties, see "Metadata Selection properties" in the "Reference" section.
Last updated: Tue 12 Dec 2006 03:32:39
(c) Copyright IBM Corporation 2005, 2006.
This information center is powered by Eclipse technology (http://www.eclipse.org)