Thank you Sathis Kumar.
It will be of great help, If you guide me to tackle this problem.
Even though i have only 4000 to 5000 records to display, it is taking 10-15 min. time.
I will give you my code sample.
code
---------------------------
<%@ page language="java" import="java.text.*,java.sql.*,java.text.NumberFormat,java.util.*,javax.servlet.http.*,java.util.Date" %>
<%
String connect=String.valueOf(session.getAttribute("connect"));
String uid=String.valueOf(session.getAttribute("uid"));
String pwd=String.valueOf(session.getAttribute("pwd"));
if(connect.equals("true"))
{
String stkno=new String();
stkno=request.getParameter("stkno").trim().toUpperCase();
%>
<html>
<head>
<title>Excel Report for Stock Items</title>
</head>
<table border="1" width="80%" align="center">
<tr bgcolor="#D2D3FF">
<td colspan="16" height="20" align="center">
<div align="center"><fontface="Verdana, Arial, Helvetica, sans-serif" size="3"><B><B>EXCEL REPORT </B></B> for
<B><B>STOCK ITEMS -
</B></b></font></div>
</td>
</tr>
</table>
<br><br>
<TABLE border=1 width="100%">
<TR>
<Th>Stock Code</Th>
<Th>Description</Th>
<Th>UOM</Th>
<Th>Forecast 1</Th>
<Th>Customer Orders</Th>
<Th>Forecast Accuracy 1 %</Th>
<Th>Good Forecast %</Th>
<Th>Forecast 1 Value</Th>
<Th>Customer Orders Value</Th>
<Th>Forecast Accuracy diff Value 1</Th>
<Th>Forecast 3</Th>
<Th>Customer orders</Th>
<Th>Forecast Accuracy 3 %</Th>
<Th>Forecast 3 Value</Th>
<Th>Forecast Accuracy diff Value 3</Th>
</TR>
<%
try
{
Connection con=null;
response.setContentType("application/vnd.ms-excel");
CallableStatement cs1=null;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc

dbc:testing",uid,pwd);
Statement s=con.createStatement();
ResultSet rs = s.executeQuery("SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15 from stock_master WHERE stockno='"+stkno+"'");
String clas=new String();
double first=0;
double fcst1=0;
double ord1=0;
double fcstp1=0;
double cntrto=0;
double fcstv1=0;
double ordv1=0;
double diff1=0;
double fcst3=0;
double fcstp3=0;
double fcstv3=0;
double diff3=0;
double diff4=0;
double diff5=0;
double diff6=0;
while (rs1.next())
{
first=rs1.getDouble(1);
fcst1=rs1.getDouble(2);
ord1=rs1.getDouble(3);
fcstp1=rs1.getDouble(4);
cntrto=rs1.getDouble(5);
fcstv1=rs1.getDouble(6);
ordv1=rs1.getDouble(7);
diff1=rs1.getDouble(8);
fcst3=rs1.getDouble(9);
fcstp3=rs1.getDouble(10);
fcstv3=rs1.getDouble(11);
diff3=rs1.getDouble(12);
diff4=rs1.getDouble(13);
diff5=rs1.getDouble(14);
diff6=rs1.getDouble(15);
%>
<tr bgcolor="#FFFFD7">
<!-- I am using number Format to display the contents or numbers along with cama and without that exponential format-->
<td Align = "CENTER" Valign = "Bottom" CLASS="Heading" colspan=2><B>Summary</B></td>
<TD align="center"><%=(NumberFormat.getInstance().format(fcst1))%></TD>
<TD><%=(NumberFormat.getInstance().format(fcst1))%></td>
<TD><%=(NumberFormat.getInstance().format(ord1))%></td>
<TD><%=(NumberFormat.getInstance().format(fcstp1))%></td>
<TD><%=(NumberFormat.getInstance().format(cntrto))%></td>
<TD><%=(NumberFormat.getInstance().format(fcstv1))%></td>
<TD><%=(NumberFormat.getInstance().format(ordv1))%></td>
<TD><%=(NumberFormat.getInstance().format(diff1))%></td>
<TD><%=(NumberFormat.getInstance().format(fcst3))%></td>
<TD><%=(NumberFormat.getInstance().format(ord1))%></td>
<TD><%=(NumberFormat.getInstance().format(fcstp3))%></td>
<TD><%=(NumberFormat.getInstance().format(fcstv3))%></td>
<TD><%=(NumberFormat.getInstance().format(diff3))%></td>
</tr>
<TR>
<TD colspan=14 align=center><a href="farip.jsp"><font SIZE=4 color="#6600FF">Back</font></a></TD>
</TR>
<%
}//end od while
rs.close();
}catch(Exception e)
{
out.println(e);
}
}//end of if connect
else
{
response.sendRedirect("login1.jsp");
}
%>
---------------------------
Similar to this while loop above, i have two more loops to fetch data from backend. I can't avoid those loops. Those are must.
Please note:
Instead of using select statements, i created views at the backend, I invoked these views with the help of CallableStatements. But still download time is more.....10-15 min.
So, can you please guide me !
Thanks in advance.
