InfoCenter Home > 4.2.2.3.8.2.4: JSP .91 syntax: <DBMODIFY> tag syntax<!-- Any valid database update commands can be placed within the DBMODIFY tag. --> <!-- Any other syntax, including HTML comments, are not valid. --> <dbmodify connection="connection_id" > </dbmodify>where:
In the following example, a new employee record is added to a database. The values of the fields are based on user input from this JSP and referenced in the database commands using <INSERT> tags. <dbmodify connection="conn" > insert into EMPLOYEE (EMPNO,FIRSTNME,MIDINIT,LASTNAME,WORKDEPT,EDLEVEL) values ('<INSERT requestparm="EMPNO"></INSERT>', '<INSERT requestparm="FIRSTNME"></INSERT>', '<INSERT requestparm="MIDINIT"></INSERT>', '<INSERT requestparm="LASTNAME"></INSERT>', '<INSERT requestparm="WORKDEPT"></INSERT>', <INSERT requestparm="EDLEVEL"></INSERT>) </dbmodify> The EmployeeRepeatResults.jsp example illustrates this tag. Displaying query resultsTo display the query results, use the <REPEAT> and <INSERT> tags. The <REPEAT> tag loops through each of the rows in the query results. The <INSERT> tag uses the query results object (for the <DBQUERY> tag whose identifier is specified by the <INSERT> bean attribute) and the appropriate column name (specified by the <INSERT> property attribute) to retrieve the value. An example is: <repeat> <tr> <td><INSERT bean="empqs" property="EMPNO"></INSERT> <INSERT bean="empqs" property="FIRSTNME"></INSERT> <INSERT bean="empqs" property="WORKDEPT"></INSERT> <INSERT bean="empqs" property="EDLEVEL"></INSERT> </td> </tr> </repeat> JSP 0.91 APIs and migrationTwo interfaces support the JSP 0.91 technology. These APIs provide a way to separate content generation (business logic) from the presentation of the content (HTML formatting). This separation enables servlets to generate content and store the content (for example, in a bean) in the request object. The servlet that generated the context generates a response by passing the request object to a JSP file that contains the HTML formatting. The <BEAN> tag provides access to the business logic. The interfaces that supported JSP 0.91 for the Application Server Version 3 are:
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|