InfoCenter Home >
4: Developing applications >
4.2: Building Web applications >
4.2.2: Developing JSP files >
4.2.2.3: Overview of JSP file content >
4.2.2.3.7: IBM extensions to JSP syntax >
4.2.2.3.7.2: JSP syntax: Tags for database access >
4.2.2.3.7.2.4a: Example: JSP syntax: <tsx:dbmodify> tag syntax

4.2.2.3.7.2.4a: Example: JSP syntax: <tsx:dbmodify> tag syntax

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 <tsx:getProperty>.

<tsx:dbmodify connection="conn" >
insert into EMPLOYEE
(EMPNO,FIRSTNME,MIDINIT,LASTNAME,WORKDEPT,EDLEVEL)
values
('<tsx:getProperty name="request" property=request.getParameter("EMPNO") />',
'<tsx:getProperty name="request" property=request.getParameter("FIRSTNME") />',
'<tsx:getProperty name="request" property=request.getParameter("MIDINIT") />',
'<tsx:getProperty name="request" property=request.getParameter("LASTNAME") />',
'<tsx:getProperty name="request" property=request.getParameter("WORKDEPT") />',
<tsx:getProperty name="request" property=request.getParameter("EDLEVEL") />)
</tsx:dbmodify>

Go to previous article: JSP syntax: <tsx:dbmodify> tag syntax Go to next article: Example: JSP  syntax: <tsx:repeat> and <tsx:getProperty> tags

 

 
Go to previous article: JSP syntax: <tsx:dbmodify> tag syntax Go to next article: Example: JSP  syntax: <tsx:repeat> and <tsx:getProperty> tags