473,388 Members | 1,220 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

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 6866
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

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

Similar topics

5
by: Jack | last post by:
Hi, I need to build a asp page where it would serve as a data entry record page as well as display page for records saved. This page should also allow editing of records that has been saved. ...
1
by: gooogle | last post by:
Hi, We need to log the fields from a IIS log into some database where it can be sorted by date and id of a record. There will be about a million records per day or more than that may be. What...
2
by: PeteCresswell | last post by:
This is pursuant to another thread I tried to start, but can't find on my server. I've got to store rolling rates of return for investment funds - calendar year, quarterly, and monthly To cut...
2
by: technocrat | last post by:
I am trying to load from a cursor which selects 124 million records...but while loading it completes the build phase and it stuck ...I think...at the delete phase(which in turn looks like doing the...
1
by: achurin | last post by:
Hi everybody, I am a rookie at the forum stuff. Please don't bash me too badly. I have created an app a few years back to store some records in a DB. According our calculations we were never to...
2
by: creative1 | last post by:
Hi Everyone, I am struct with one report. I use a number of recordsets to meet requirements of my report. It works fine but the problem is: It displays only first record; I need to have all...
1
by: azgaranoop | last post by:
Hi, i want to display a alert box when a user leave my site.... Means if a user clck on X button i.e on top right corner of the browser or the user click on the address bar and try to change the...
13
by: ramprakashjava | last post by:
hi, i hav "java.lang.NullPointerException" error while Deleting table records using checkbox in jsp here i enclosed files help quickly plzzz.. ...
0
by: reachwasim | last post by:
I have a project to handle where there are close to 50 to 60 million records. My job would be migrating the data from textfile to a database and then develop a UI to query the data. My only...
0
by: nam pai | last post by:
im using java excel api and trying to add some more records to the existing excel sheet. im using writable workbook hence every time i try to add a record it creates a new workbook and writes the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.