Hi
Thanks to you all for previous reply. And I am sorry if I have offended you
by sending a direct mail to you Lesley.
My JSP page is as follows... If I do the refresh through java script then
it would refresh and would load the same values again & again. My Bean is
not returning the new value immediately so that the next queries get ready
from the first value.
Please suggest... if possible with some Codes...
Thanks again
===========
<%@ page import="java.sql.*,java.io.*, java.lang.*, javax.servlet.
*,javax.servlet.http.*" %>
<jsp:useBean id="dbConnect" class="poenquiry.jspDbAccess" scope="session" >
<jsp:setProperty name="dbConnect" property="*" />
</jsp:useBean>
<script language="javascript">
function refresh()
{
window.location.reload();
}
</script>
<html>
<head> <title>Puchase Order Enquiry</title> </head>
<body text="White"
bgcolor="#000000"
leftmargin=0
topmargin=0
marginwidth=0
marginheight=0>
<hr align="left" width=19% size=2 color="White">
<table width="175" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="TOP">
<img align="middle" src="../../images/jpLogo_3.gif" width=149
height=75 border=0
alt="Jobpac Logo"></td>
</tr>
</table>
<hr align="left" width=19% size=2 color="White">
<img align="middle" src="../../images/poEnquiry.gif" width=780 height=16
border=0 alt="Jobpac Logo">
<% ResultSet rs=null;
Statement stmt=null;
String workid;
String idDescript;
String firm;
String job;
String jobDescript=" ";
String costcode;
String costcodeDescript=" ";
String dataLibrary=null;
%>
<% if ((request.getParameter( "Workid" ) != null) &&
(request.getParameter( "Firm" ) != null) &&
(request.getParameter( "Job" ) != null) &&
(request.getParameter( "Costcode" ) != null) &&
(request.getParameter( "Resultset" ) != null)) { %>
----
----
----
%>
<% } else { %>
<FORM NAME='login'METHOD=get>
<TABLE border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="right">Workid </td>
<td><select name="Workid" size="1" onChange
="javascript:refresh()">
<%
while(rs.next()) {
%>
<option value="<%=rs.getObject(1) %>" > <%=rs.getObject(1) %>
<% }
}
catch (Exception exp)
{
out.print("Error at data Processing. Please Try Again.");
}
%>
</select>
</td>
<%
workid = request.getParameter( "Workid" );
String query01="SELECT WISNAM, WIKM1, WIKM2 from r51ACTL.@WKIDWIP
WHERE WIWINO=01" ;
dbConnect.setResultset(query01);
rs = dbConnect.getResultset();
try
{
while(rs.next()) {
%>
<td><%=rs.getObject(1) %></td>
</tr>
<tr>
<td align="right">Firm </td>
<td><input type="TEXT" name="Firm" size="3" value=<%=rs.getObject(2)
%>></td>
</tr>
<%
dataLibrary=rs.getString(3);
}
}
catch (Exception exp)
{
out.print("Error at data Processing. Please Try Again.");
}
String query02="SELECT JOB from "+ dataLibrary +" .JOBS";
dbConnect.setResultset(query02);
rs = dbConnect.getResultset();
try
{
%>
<tr>
<td align="right">Job </td>
<td><select name="Job" size="1">
<%
while(rs.next()) {
%>
<option value="<%=rs.getObject(1) %>"> <%=rs.getObject(1) %>
<%
}
}
catch (Exception exp)
{
out.print("Error at data Processing. Please Try Again.");
}
%>
</select>
</td>
<%
String jobname = request.getParameter( "job" );
String query03="SELECT DESCRIPT from "+ dataLibrary +" .JOBS WHERE
JOB='GW0001' ";
dbConnect.setResultset(query03);
rs = dbConnect.getResultset();
try
{
while(rs.next()) {
%>
<td><%=rs.getString(1) %></td>
</tr>
<%
}
}
catch (Exception exp)
{
out.print("Error at data Processing. Please Try Again.");
}
%>
<tr>
<td align="right">Cost Code </td>
<td><input type="TEXT" name="Costcode" size="10"></td>
</tr>
<tr>
<td><input type="HIDDEN" name="Resultset" ></td>
</tr>
<tr>
<td align="Left"></td>
<td align="right">
<input type="SUBMIT" value=" Start Query ">
<input type="RESET" value="Clear"></td>
</tr>
</TABLE>
</FORM>
<hr align="Left" Color="White" Size="1">
Please enter the values & press 'Start Query'...press 'Clear' for new
entry.
<% } %>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets