Exceeding the memory size !!!!!
I've written the code, but it is exceding the memory size. Could anyone tell me how to get rid of this exception.....
The code is as follows....
if(export_data.equals("ex")){
PrintWriter out = response.getWriter();
try{
response.setContentType("applicaton/download");
response.setHeader("Content-Disposition","attachment; filename=data.txt");
//rs = stmt.executeQuery("select * from PHONE_NUMBERS_LIST order by PHONE_NUMBER");
rs = stmt.executeQuery("select PHONE_NUMBER,MIN(PHONE_MODEL),MIN(MANUFACTURER) FROM PHONE_NUMBERS_LIST GROUP BY PHONE_NUMBER");
//around 33 laks data
while(rs.next()){
out.write(rs.getString(1).trim());
out.write("\t");
out.write(rs.getString(2).trim());
out.write("\t");
out.write(rs.getString(3).trim());
out.write("\r\n");
}
out.close();
}catch(Exception e){
System.out.println("This is in exporting the file"+e);
}
The data is more (around 33 laks). So, what should i do for this. How to get rid of this , please help me out in this regard.... The exception i'm throwing is:
This is in exporting the filecom.microsoft.sqlserver.jdbc.SQLServerException: The system is out of memory. Use server side cursorsfor large result sets:Java heap space. Result set size:104,167,523. JVM total memory size:66,650,112.
The problem is for size only.... Please tell me how to design this code to evade from this exception......
in advance thanks......

