129 lines
5.0 KiB
HTML
129 lines
5.0 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<LINK rel="stylesheet" type="text/css" href="../../../rzahg/ic.css">
|
|
|
|
<title><tsx:dbquery></title>
|
|
</head>
|
|
|
|
<BODY>
|
|
<!-- Java sync-link -->
|
|
<SCRIPT LANGUAGE="Javascript" SRC="../../../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
|
|
|
|
<h5><a name="jspexam"></a>JSP10employeeRepeatResults.jsp example</h5>
|
|
<p>See the <a href="codex.htm">Code example disclaimer</a> for legal information about this code examples.</p>
|
|
<pre>
|
|
<!-- JSP10employeeRepeatResults.jsp -->
|
|
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>JSP 1.0 Employee Results</TITLE>
|
|
</HEAD>
|
|
<H1><CENTER>EMPLOYEE RESULTS</CENTER></H1>
|
|
<BODY>
|
|
|
|
<% String userID = request.getParameter("USERID"); %>
|
|
<% String passWord = request.getParameter("PASSWD"); %>
|
|
|
|
<% 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"); %>
|
|
|
|
<!-- Get a connection to the local DB2 database using parameters from Login.jsp -->
|
|
<tsx:dbconnect id="conn" url="jdbc:db2:*local" driver="com.ibm.db2.jdbc.app.DB2Driver">
|
|
<tsx:userid><%=userID%></tsx:userid>
|
|
<tsx:passwd><%=passWord%></tsx:passwd>
|
|
</tsx:dbconnect>
|
|
|
|
<% if ( ( request.getParameter("Submit")).equals("Update") ) { %>
|
|
<tsx:dbmodify connection="conn" >
|
|
INSERT INTO WSDEMO.EMPLOYEE
|
|
(EMPNO,FIRSTNME,MIDINIT,LASTNAME,WORKDEPT,EDLEVEL)
|
|
VALUES
|
|
( '<%=empno%>',
|
|
'<%=firstnme%>',
|
|
'<%=midinit%>',
|
|
'<%=lastname%>',
|
|
'<%=workdept%>',
|
|
<%=edlevel%>)
|
|
</tsx:dbmodify>
|
|
<B><UL>UPDATE SUCCESSFUL</UL></B>
|
|
<BR><BR>
|
|
<tsx:dbquery id="qs" connection="conn" >
|
|
select * from WSDEMO.EMPLOYEE where WORKDEPT= '<%=workdept%>'
|
|
</tsx:dbquery>
|
|
|
|
|
|
<B><CENTER><U>EMPLOYEE LIST</U></CENTER></B><BR><BR>
|
|
<HR>
|
|
<TABLE>
|
|
<TR VALIGN=BOTTOM>
|
|
<TD><B>EMPLOYEE
|
|
<BR>
|
|
<U>NUMBER</U></B></TD>
|
|
<TD><B><U>NAME</U></B></TD>
|
|
<TD><B><U>DEPARTMENT</U></B></TD>
|
|
<TD><B><U>EDUCATION</U></B></TD>
|
|
</TR>
|
|
|
|
<tsx:repeat>
|
|
<TR>
|
|
<TD><B><I><tsx:getProperty name="qs" property="EMPNO" /></I></B></TD>
|
|
<TD><B><I><tsx:getProperty name="qs" property="FIRSTNME" /></I></B></TD>
|
|
<TD><B><I><tsx:getProperty name="qs" property="WORKDEPT" /></I></B></TD>
|
|
<TD><B><I><tsx:getProperty name="qs" property="EDLEVEL" /></I></B></TD>
|
|
</TR>
|
|
</tsx:repeat>
|
|
|
|
</TABLE>
|
|
|
|
|
|
<HR>
|
|
<BR>
|
|
<% } %>
|
|
|
|
<% if ( ( request.getParameter("Submit")).equals("Query") ) { %>
|
|
|
|
<tsx:dbquery id="qs2" connection="conn" >
|
|
select * from WSDEMO.EMPLOYEE where WORKDEPT= '<%=workdept%>'
|
|
</tsx:dbquery>
|
|
|
|
|
|
<B><CENTER><U>EMPLOYEE LIST</U></CENTER></B><BR><BR>
|
|
<HR>
|
|
<TABLE>
|
|
<TR>
|
|
<TR VALIGN=BOTTOM>
|
|
<TD><B>EMPLOYEE
|
|
<BR>
|
|
<U>NUMBER</U></B></TD>
|
|
<TD><B><U>NAME</U></B></TD>
|
|
<TD><B><U>DEPARTMENT</U></B></TD>
|
|
<TD><B><U>EDUCATION</U></B></TD>
|
|
</TR>
|
|
|
|
<tsx:repeat>
|
|
<TR>
|
|
<TD><B><I><tsx:getProperty name="qs2" property="EMPNO" /></I></B></TD>
|
|
<TD><B><I><tsx:getProperty name="qs2" property="FIRSTNME" /></I></B></TD>
|
|
<TD><B><I><tsx:getProperty name="qs2" property="WORKDEPT" /></I></B></TD>
|
|
<TD><B><I><tsx:getProperty name="qs2" property="EDLEVEL" /></I></B></TD>
|
|
</TR>
|
|
</tsx:repeat>
|
|
</TABLE>
|
|
<HR>
|
|
<BR>
|
|
<% } %>
|
|
|
|
</BODY>
|
|
</HTML>
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
</html>
|