Binding a Database Data Source to a Mobile Business Object

Bind the attributes and operations of a database object to a mobile business object.

  1. In the Bind Data Source wizard, enter the following information and click Next:
    Field Action
    Specify data source Select and bind to a data source now.
    Data source type Select JDBC from the drop-down list.
    Connection profile Select the database connection profile to which you are binding your mobile business object attributes. If the required data source is not in the list, click Create to define a new connection profile.
  2. Follow the wizard instructions to configure and bind data source information to mobile business object attributes and operations. Some fields are specific to attributes, while others are common to both attributes and operations. For example, Result set filters are attribute specific.
    Field Action
    Data source specific information In the wizard, enter the SQL statement used to access the database information. Click:
    • SQL Statement Type – either a SQL query statement or a stored procedure.
    • Validate syntax – to validate the syntax of the SQL statement.
    • Preview – to view the results of the SQL statement against the data source.
    Runtime Data Source Credential (Optional) The User Name and Password required to gain access to the runtime data source.

    The user name and password can be entered directly, retrieved from a personalization key, or by selecting New key and creating a new personalization key.

    Result set Filters Optionally add a result set filter to the MBO.

    A result set filter is a custom Java class that manipulates the rows or columns of data returned from a read operation for an MBO. To write a filter, developers must have previous experience with Java programming — particularly with the reference implementations for javax.sql.RowSet, which is used to implement the filter interface. See Result Set Filters.

    Parameters From the Parameters page you can configure these MBO argument properties that are modeled from the data source's remote operation argument:
    • Argument – the MBO argument name
    • Datatype – datatype of the argument
    • Nullable – identifies if NULL is a valid value
    • Default value – the default value, if any, of the MBO argument

    Due to JDBC driver meta data retrieval related API limitations, Unwired WorkSpace does not always set the correct attribute length, especially for operation and load argument types and lengths, and you must set them manually to avoid run-time errors.

    Attributes Mapping Attributes mapping is generated as follows:
    1. The tabular view columns are generated automatically.
    2. If an existing attribute matches the name and data type of one of the columns, they are mapped.
    3. Otherwise, you must manually link (map) from the attribute to the tabular view columns.
    (Properties view only) The methods that you use to map attributes include:
    1. In the visual portion of the diagram, drag from the square icon of an attribute to the square icon of a tabular view column.

    2. In the bottom table, select a column from the drop-down list of the map To cell.
    From the Attributes Mapping screen, you can modify the mappings by selecting:
    • Up or Down – adjust attribute position.
  3. The Role Assignments screen allows you to Create, Add, and Remove role assignments from the mobile business object.
  4. Click Finish when done.
    The Mobile Application Diagram is refreshed with the new mobile business object attributes.