Using JDBC ODA in Business Object Designer

This section describes how to use the JDBC ODA in Business Object Designer to generate business object definitions. For information on launching Business Object Designer, see the Business Object Development Guide. You can download this book from the IBM WebSphere Business Integration Adapters InfoCenter: http://www.ibm.com/websphere/integration/wbiadapters/infocenter

After you launch an ODA, you must launch Business Object Designer to configure and run it. There are six steps in Business Object Designer to generate a business object definition using an ODA. Business Object Designer provides a wizard that guides you through each of these steps.

After starting the ODA, do the following to start the wizard:

  1. Open Business Object Designer.
  2. From the File menu, select the New Using ODA... submenu.

    Business Object Designer displays the first window in the wizard, named Select Agent. Figure 6 illustrates this window.

To select, configure, and run the ODA, follow these steps:

  1. Select the ODA
  2. "Configure initialization properties"
  3. "Expanding nodes and selecting database objects"
  4. "Confirming database object selections"
  5. "Generating definitions" and, optionally, "Providing additional information"
  6. "Saving definitions"

Select the ODA

Figure 6 illustrates the first dialog box in Business Object Designer's six-step wizard. From this window, select the ODA to run.

Figure 6. Selecting the ODA


To select the ODA:

  1. Click the Find Agents button to display all registered or currently running ODAs in the Located agents field.
    Note:
    If Business Object Designer does not locate your desired ODA, check the setup of the ODA.
  2. Select the desired ODA from the displayed list.

    Business Object Designer displays your selection in the Agent's name field.

  3. Click Next.

Configure initialization properties

The first time Business Object Designer communicates with the JDBC ODA, it prompts you to enter a set of initialization properties as shown in Figure 7. You can save these properties in a named profile so that you do not need to re-enter them each time you use the JDBC ODA. For information on specifying an ODA profile, see the Business Object Development Guide. You can download this book from the IBM WebSphere Business Integration Adapters InfoCenter.

Figure 7. Configuring agent initialization properties


Configure the JDBC ODA properties described in Table 8.

Table 8. JDBC ODA properties

Row number Property name Property type Description
1
UserName
String Name of the user with authorization to connect to the database
2
Password
String Password of the user with authorization to connect to the database
3
DatabaseUrl
String URL that enables a connection to the database. For example: jdbc:oracle:thin:@MACHINENAME:1521:SIDNAME
4
DatabaseDriver
String Name of the driver used to establish the connection. For example: oracle.jdbc.driver.OracleDriver
5
DefaultBOPrefix
String Text that is prepended to the name of the business object to make it unique. You can change this later, if required, when Business Object Designer prompts you for business object properties. For more information, see "Providing additional information".
6
TraceFileName
String File into which the JDBC ODA writes trace information. If the file does not exist, the JDBC ODA creates it in the \ODA\JDBC directory. If the file already exists, the JDBC ODA appends to it. The JDBC ODA names the file according to the naming convention. For example, if the agent is named JDBCODA, it generates a trace file named JDBCODAtrace.txt. Use this property to specify a different name for this file.
7
TraceLevel
Integer Level of tracing enabled for the JDBC ODA. See Table 7.
8
MessageFile
String Name of the error and message file. The JDBC ODA displays the filename according to the naming convention. For example, if the agent is named JDBCODA, the value of the message file property displays as JDBCODAAgent.txt.Important: The error and message file must be located in the \ODA\messages directory. Use this property to verify or specify an existing file.
Important

Correct the name of the message file if the default value displayed in Business Object Designer represents a non-existent file. If the name is not correct when you move forward from this dialog box, Business Object Designer displays an error message in the window from which the ODA was launched. This message does not pop up in Business Object Designer. Failing to specify a valid message file causes the ODA to run without messages.

Expanding nodes and selecting database objects

After you configure all initialization properties for the JDBC ODA, Business Object Designer connects to the specified database and displays a tree with all the schema names in the database. These names, which are presented as nodes in the tree, are expandable. Click on them to display all the tables, views, stored procedures and synonyms/nicknames in each schema. Figure 8 illustrates this dialog box with some schema expanded.

Figure 8. Tree of Schema with expanded nodes


To identify all the database objects that store data for the generated business object definition, select all the required tables, views, stored procedures, and synonyms/nicknames; and click Next. For information on how to filter the objects returned, see the Business Object Development Guide. You can download this book from the IBM WebSphere Business Integration Adapters InfoCenter.

The schema name ALL SCHEMAS is used to facilitate the retrieval of objects such as tables and views from databases that don't have schemas associated with the objects. When you expand ALL SCHEMAS, a tree is shown with tables, views, stored procedures, and synonyms/nicknames. When each of these nodes is expanded, all the relevant objects from the database appear, regardless of the schema to which the object belongs.

Figure 9. Expanding ALL SCHEMAS to retrieve objects


Confirming database object selections

After you identify all the database objects to be associated with the generated business object definition, Business Object Designer displays the dialog box with only the selected tables, views, stored procedures, and synonyms/nicknames. Figure 10 illustrates this dialog box.

Figure 10. Confirming selection of database objects


This window provides the following options:

Generating definitions

After you confirm the database objects, a dialog box informs you that Business Object Designer is generating the definitions.

Providing additional information

If the JDBC ODA needs additional information, Business Object Designer displays the BO Properties window, shown in Figure 11, which prompts you for the information.

Figure 11. Providing additional information about database objects


In the BO Properties window, enter or change the following information:

Figure 12. Selecting stored procedure attributes


Note:
If a field in the BO Properties dialog box has multiple values, the field appears to be empty when the dialog box first displays. Click in the field to display a drop-down list of its values.

The stored procedure attributes to be added to the business object can be associated with one of the stored procedures in the database in that schema. As shown in Figure 13, you can choose a stored procedure from a drop-down list of all stored procedures in the database in that schema, against each stored procedure attribute. This information will generate the necessary application-specific information for that attribute.

Figure 13. Associating stored procedures with stored procedure attributes


The application-specific information (ASI) for the object level will look like TN=tableName

And for the attribute level, the ASI will look like CN=ColumnName

If a business object is generated from a stored procedure, and if the JDBC connector stored procedure attributes (such as SPForCreate) are associated with it, then the ODA provides a list of all stored procedure names in that schema against the stored procedure attributes. The ODA enables you to associate the required stored procedure with the business object. This generates the ASI for the JDBC connector stored procedure attribute as follows:

SPN=stored procedure Name; IN=a1:a2; OUT=b1:b2; IO=c1:c2

Where IN means the parameter of the stored procedure is INPUT type, OUT means the parameter is OUTPUT type, and IO means it is INPUT/OUTPUT type. The ODA will not set RS to true or false on the ASI, so you need to set it manually.

The verbs added to the business object are the standard verbs, essentially Retrieve, RetrieveByContent, Create, Update and Delete.

If the return parameter of the stored procedure is of ResultSet Type, the ODA will analyze the result set and create a business object, making the columns of the result set attributes of the business object. The ASI for the stored procedure columns will be set as CN=StoredProcedureColumnName. The ODA sets the key attributes based on the JDBC metadata information returned by the driver. If none is returned, the ODA does not mark any attributes by default as keys. All other attributes, such as length and type, are set as for the attributes generated from tables.

Saving definitions

After you provide all required information in the BO Properties dialog box and click OK, Business Object Designer displays the final dialog box in the wizard. Here, you can save the definition to the server or to a file, or you can open the definition for editing in Business Object Designer. For more information, and to make further modifications, see the Business Object Development Guide. You can download this book from the IBM WebSphere Business Integration Adapters Infocenter.

Copyright IBM Corp. 1997, 2004