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
22 6664
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.
[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
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 ;-)
lac is nothing million data(more than one million data)
rajesh
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.
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.
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
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(" ");
}
}
DataBufferofTable.append("<TR>\n");
}
DataBufferofTable.append("\n");
DataBufferofTable.append("</table>\n");
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
after setting setFetchSize(120000)
again the same problem,
heap size erroe . tell me wht i do,
i have to solve today that problem
rajesh
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
i want to display the data in jsp pages.
using the oracel database
thanks , but tell me different way
pl try.
solve today
rajesh
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
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.
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
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
i amusing the jdbc , type 4 diver, tell me how i solve the problem.
heap error
rajesh
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
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
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
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
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
Post your reply Sign in to post your reply or Sign up for a free account.
Similar topics
5 posts
views
Thread by Jack |
last post: by
|
1 post
views
Thread by gooogle |
last post: by
|
2 posts
views
Thread by PeteCresswell |
last post: by
|
2 posts
views
Thread by technocrat |
last post: by
|
1 post
views
Thread by achurin |
last post: by
| | | | | | | | | | | | | | | |