469,271 Members | 1,743 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

its urgent display the 2 million records in jsp using java

hello,
i am storing the more than 1 lac data in string buffer, it gives the errro java heap size now , i increase that hepa size , but still is giving error,
plz. tell me how i display the whole record at once time
rajesh
as earliest as possibel
Aug 17 '07 #1
22 6457
r035198x
13,262 8TB
hello,
i am storing the more than 1 lac data in string buffer, it gives the errro java heap size now , i increase that hepa size , but still is giving error,
plz. tell me how i display the whole record at once time
rajesh
as earliest as possibel
What error did you say it gives? Pleas post the exact error message that you got.
Aug 17 '07 #2
[exception

javax.servlet.ServletException: Servlet execution threw an exception


root cause

java.lang.OutOfMemoryError: Java heap space

plz give me solution.
i increase the heap size 256 to 1024
Aug 17 '07 #3
JosAH
11,448 Expert 8TB
What error did you say it gives? Pleas post the exact error message that you got.
I guess the question is identical to this question.

It's probably an OutOfMemoryError and I even know now what a 'lac' is ;-)

kind regards,

Jos

edit: I started posting a bit too late ;-)
Aug 17 '07 #4
lac is nothing million data(more than one million data)
rajesh
Aug 17 '07 #5
r035198x
13,262 8TB
lac is nothing million data(more than one million data)
rajesh
Perhaps if we see the code you're using for this.

P.S Code should be wrapped in code tags.
Aug 17 '07 #6
madhoriya22
252 100+
lac is nothing million data(more than one million data)
rajesh
Hi,
I think the exact relation b/w lac and million is...
10lacs = 1 million. :)

thanks and regards,
madhoriya.
Aug 17 '07 #7
JosAH
11,448 Expert 8TB
Hi,
I think the exact relation b/w lac and million is...
10lacs = 1 million. :)
I think so too; at least that's what I understood in that other thread (see the link).

kind regards,

Jos
Aug 17 '07 #8
ther is no link, ok. sorry, only 2 lacs ok.
not 10 lacs.
my code is where i using the strng buffer

while(resultset.next())
{
DataBufferofTable.append("<tr>");
for(int i=1; i<= numberofColumns;i++)
{
DataBufferofTable.append("<td>");
// make the object to access the each & every column value
Object obj=resultset.getObject(i);

if(obj!= null)
{

DataBufferofTable.append(obj.toString());
// collection.add(obj);
}
else
{
DataBufferofTable.append("&nbsp;");
}


}

DataBufferofTable.append("<TR>\n");
}
DataBufferofTable.append("\n");

DataBufferofTable.append("</table>\n");
Aug 17 '07 #9
JosAH
11,448 Expert 8TB
That code seems correct by itself; it's just that the resultset is too large to keep
it in memory. You wrote that increasing the heap size (the -Xmx flag) doesn't
help. In the other (identical problem) thread I suggested to play with the setFetchSize()
a bit and see if it helps. Read the API docs for the Statement interface.

kind regards,

Jos
Aug 17 '07 #10
after setting setFetchSize(120000)
again the same problem,
heap size erroe . tell me wht i do,

i have to solve today that problem
rajesh
Aug 17 '07 #11
JosAH
11,448 Expert 8TB
after setting setFetchSize(120000)
again the same problem,
heap size erroe . tell me wht i do,

i have to solve today that problem
rajesh
Well, the result is simply too large; it is ridiculous to attempt to display that
many records in one single html page anyway. Google for "jsp paging" instead
or check your database if its SQL supports statement directives like "offset" and
"limit".

kind regards,

Jos
Aug 17 '07 #12
i want to display the data in jsp pages.
using the oracel database

thanks , but tell me different way
pl try.
solve today
rajesh
Aug 17 '07 #13
JosAH
11,448 Expert 8TB
i want to display the data in jsp pages.
using the oracel database

thanks , but tell me different way
pl try.
solve today
rajesh
Did you read my previous reply? 2 million records is just too much to display
in one single page. You have to use several pages and a 'prev' and 'next' button.
Most databases have support for that: they can skip 'n' records and retrieve the
next 'm' records if available.

kind regards,

Jos
Aug 17 '07 #14
praveen2gupta
201 100+
Hi
The Resultset capacity is to store 1000 results at a time in the oracle. You can not fetch this much of data at once on the jsp page.
secondly your server will be too busy to fetch this much of data and it will take a longer time and might be possible that it may not deliver the results. So divide your data in small lots.
Aug 17 '07 #15
i have no problem upto 20 thousand ,but if i want to dispaly more the n20,000
then it is creating the error,
i do the paging, but i want to put one option to view all recors at one time.
rajesh
Aug 17 '07 #16
JosAH
11,448 Expert 8TB
The Resultset capacity is to store 1000 results at a time in the oracle.
That number highly depends on the database vendor and its JDBC driver. Normally
Oracle's JDBC can deliver many more records in its resultset than just 1,000.
It's a heap memory problem.

kind regards,

Jos
Aug 17 '07 #17
i amusing the jdbc , type 4 diver, tell me how i solve the problem.
heap error
rajesh
Aug 17 '07 #18
JosAH
11,448 Expert 8TB
i amusing the jdbc , type 4 diver, tell me how i solve the problem.
heap error
rajesh
Please read or reread my reply #12:

Well, the result is simply too large; it is ridiculous to attempt to display that
many records in one single html page anyway. Google for "jsp paging" instead
or check your database if its SQL supports statement directives like "offset" and
"limit".

kind regards,

Jos
Aug 17 '07 #19
i am using the oracle, it doen't support the offset & limit.
but i want to do tell how it will be happen,
have any one done before.
Is it happen. or not .
but
i have to do
Aug 17 '07 #20
JosAH
11,448 Expert 8TB
i am using the oracle, it doen't support the offset & limit.
but i want to do tell how it will be happen,
have any one done before.
Is it happen. or not .
but
i have to do
Google for it; I did the same and found it in just a few seconds; don't be lazy.
Hint: rownum.

kind regards,

Jos
Aug 17 '07 #21
hi, i tried to access the roew no. 30000, it giving ,
i think the problem is storing the large amount of data in in string buffer.
so, can u tell me how i remove that.

this will big effect of my job.
rajesh
Aug 17 '07 #22
JosAH
11,448 Expert 8TB
hi, i tried to access the roew no. 30000, it giving ,
i think the problem is storing the large amount of data in in string buffer.
so, can u tell me how i remove that.

this will big effect of my job.
rajesh
Have you actually read and *understood* my replies? If you want to display
such a ridiculous amount of rows you stand the risk that it won't fit in memory
anymore and besides: users don't want to scroll humongous amounts of rows
they're not interested in. Paginate the result of that large table as I indicated.

For your Oracle SQL, the 'rownum' keyword is the way to go. For ProgeSQL
it would've been 'limit' and 'offset'; for other databases check their manuals.

A few navigation buttons on the page itself will do the rest. Store the current
block/page number in the user's Session object and you're in business.

kind regards,

Jos
Aug 17 '07 #23

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by gooogle | last post: by
2 posts views Thread by technocrat | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.