Specifying Server-side Information for a serviceRequest

To specify the server-side information to process a serviceRequest on the server, follow these steps:

1. Open the Nexaweb Data Services perspective: select Window > Open Perspective > Nexaweb Data.

2. Click + besides Databases in the Data Source Explorer view to expand the list.

3. Right click on a database and select Connect.
A database Schema tree appears.

4. Either:

Drag and Drop

Right Click

Click on the table or column in the Data Source Explorer view from which you want to access data and drag it onto the Service Requests folder in the Data view.

The Create Database Connection dialog appears.

Right click on the table or column in the Data Source Explorer view from which you want to access data and select Nexaweb > Create SQL Service Request.
The Create SQL Service Request dialog appears as shown in Figure 130. Go on to Step 6.

 

5. Complete the Create Database Connection dialog as follows:

image\img00605.gif

Select a driver from the drop-down: Click the arrow in this picklist to select the driver for the type of database to which to connect. To add a new database, click the button to the right of the picklist. For more information on adding a database, see Connecting Nexaweb Studio to a Database.

After you select a driver, Nexaweb Studio automatically populates the ID, URL and Driver fields.

ID: Nexaweb Studio automatically assigns an ID as Driver-typeConnection, with a suffix incremented by one for each additional connection of this driver type created. Use the assigned ID or create your own.

URL: The JDBC URL supported by the specified Java driver. The URL identifies the database for the driver to make a connection to it. The URL format varies by driver.

Driver: Specifies the main Java class that implements the selected driver.

Optional properties: Specify any properties required for this connection in name/value pairs.

 Click Next.
The
Create SQL Service Request dialog appears.

image\img00606.gif

Figure 130: Create SQL Service Request dialog

6. Click on the type of statement to create and click Next.
Note: The pre-defined SQL statement types allow you to create an SQL statement using Where grammar. To use additional SQL grammar in a statement, select the SqlStatement type.
A
Create Sql Statement dialog appears specifying the type of statement you selected.

7. Complete the Create Sql Statement dialog as follows:
Note: If you selected to create an SqlStatement type, the following dialog contains an empty text box below the Attribute Settings. Enter a free-form SQL statement in the text box.

 

image\img00607.gif

ID: Nexaweb Studio automatically assigns an ID as the statement type, with a suffix incremented by one for each additional statement of this type that you create. You can keep the assigned ID or specify your own. Nexaweb Studio uses this ID to identify this SQL statement in the nexaweb-sql.xml file and to identify the dataRequestDefinition in the nexaweb-data.xml file that references this SQL statement.

ConnectionId: Specifies the ID of the connection to the database which you want to access.

StatementHandlerId: Specifies the ID of a statementHandler to use for this data.

Table: Displays the name of the table selected from the database in the text field, and the entire database schema in the list box from which you can select any table with which to work.

Columns: Displays the columns of the selected table. A check-mark appears in the checkbox beside each column of the table this SQL statement will affect. Click Select All or Deselect All, or the check box beside an individual column to change its selection. To change the order in which data from these columns appear in the UI, click on a column and click Up or Down to move it.

Where: Optionally, specify free-form where syntax to complete this sql statement.

8. Click Finish.

 Nexaweb Studio adds this SQL statement (with the ID displayed on this dialog) to the nexaweb-sql.xml file. Nexaweb Studio creates a dataRequestDefinition (with the ID displayed on this dialog) to the nexaweb-data.xml file that includes a serviceResourceReference to this SQL statement created in the nexaweb-sql.xml file.

Now, go on to create a serviceRequest.