Dreamweaver

Run a stored procedure (JSP)

With JSP pages, you must add a Callable server behavior to a page to run a stored procedure.

  1. In Dreamweaver, open the page that will run the stored procedure.
  2. In the Bindings panel (Window > Bindings), click the Plus (+) button and select Callable (Stored Procedure).
  3. In the Callable (Stored Procedure) dialog box, enter a name for the stored procedure.
  4. In the Connections pop‑up menu, select a connection to the database containing the stored procedure.
  5. In the Database Items box, expand the Stored Procedures branch, select the stored procedure from the list, and click the Procedure button.

    Dreamweaver automatically fills in the Callable Text and Variables boxes.

  6. Select the Returns Recordset Named option, enter a name for the recordset, if the stored procedure returns a recordset, and then click the Test button to see the recordset that the stored procedure returns.

    Dreamweaver runs the stored procedure and displays the recordset, if any.

    Note: If the stored procedure returns a recordset and takes parameters, you must enter a value in the Default Value column in the Variables box to test the stored procedure.
  7. Click OK.

    After you close the Callable (Stored Procedure) dialog box, JSP code is inserted in your page. When the code runs on the server, it calls a stored procedure in the database. The stored procedure in turn performs a database operation, such as inserting a record.

    If the stored procedure takes parameters, you can create a page that gathers the parameter values and submits them to the page with the stored procedure. For example, you may create a page that uses URL parameters or an HTML form to gather parameter values from users.