<tsx:dbmodify>

Use the <tsx:dbmodify> syntax to establish a connection to a database and then add records to a database table.

The <tsx:dbmodify> tag:

The <tsx:dbmodify> syntax is:

<tsx:dbmodify connection="connection_id" >

  <!-- Any valid database update commands can be       ->
  <!-- placed within the tsx:dbmodify tag. Any other   ->
  <!-- syntax, including HTML comments, are not valid. ->
  
</tsx:dbmodify>

The following list describes the attributes and their values:

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

<% String   empno    = request.getParameter("EMPNO"); %>
<% String   firstnme = request.getParameter("FIRSTNME"); %>
<% String   midinit  = request.getParameter("MIDINIT"); %>
<% String   lastname = request.getParameter("LASTNAME"); %>
<% String   workdept = request.getParameter("WORKDEPT"); %>
<% String   edlevel  = request.getParameter("EDLEVEL"); %>

<tsx:dbmodify connection="conn" >
   INSERT INTO  WSDEMO.EMPLOYEE 
   (EMPNO,FIRSTNME,MIDINIT,LASTNAME,WORKDEPT,EDLEVEL)
   VALUES
    ( '<%=empno%>',
      '<%=firstnme%>',
      '<%=midinit%>',
      '<%=lastname%>',
      '<%=workdept%>',
      <%=edlevel%> )
</tsx:dbmodify>