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 JavaServer Pages (JSP) file and referenced in the database commands using the <tsx:getProperty> tag.
<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>
Related concepts
JavaServer Pages
Related reference
Web applications: Resources for learning