<%! String dataSrcStr; %>
<%@ include file="checkDataSource.jsp" %>

<%@ taglib uri="http://xmlns.oracle.com/j2ee/jsp/tld/ojsp/sqltaglib.tld" prefix="sql" %>
<HTML> 
<HEAD><TITLE>DML Sample</TITLE></HEAD>
<BODY BGCOLOR="#FFFFFF"> 
<FORM METHOD=post>
<input type="text" name="id"><br>
<input type="text" name="name" value="PGuo"><br>
<input type="text" name="job" value="CLERK"><br>
<input type="text" name="sal" value="100"><br>
<INPUT TYPE="submit" name="insert" VALUE="Insert"><br>
</FORM>
<br>
Attribute id2 in session: <%= session.getValue("id2") %>
<br>
<% if( request.getParameter("id") != null ) {
%>
<P>
id: <%= request.getParameter("id") %><br>
name: <%= request.getParameter("name") %><br>
job: <%= request.getParameter("job") %><br>
sal: <%= request.getParameter("sal") %><br>
<sql:dbSetParam name="id2" value='<%=request.getParameter("id")%>' scope="session"/>
Result:
            <HR>
            <sql:dbOpen dataSource="<%= dataSrcStr %>"  >
              <sql:dbExecute output="yes" bindParams="id2 name job sal">
                insert into emp(empno, ename, deptno, job, sal) values (?, ?, 20, ?, ?)
              </sql:dbExecute>
            </sql:dbOpen>
            <HR> 
<% }
%>
</BODY> 
</HTML> 

