Hi,
This is vinod.
i have tried to read a 10 lacks records with column count 14 from the database at a single time. But my application shows OUT OF MEMORY error.
Any help?
my id : <id removed per posting guidelines>
Thanks,
Vinod
15 8714
Hi,
This is vinod.
i have tried to read a 10 lacks records with column count 14 from the database at a single time. But my application shows OUT OF MEMORY error.
Any help?
my id : <id removed as per posting guidelines>
Thanks,
Vinod
How much is 'a 10 lacks'?
kind regards,
Jos
10,00,000
Thanks,
vinod
So that's one million records with 14 columns each? It depends a bit on the length
of the columns but I can see that you get an OutOfMemoryError ... there are a
few -X flags that increase the JVM's heap size but I think that's just postponing
the execution. What do you want to load that many records in memory at once?
kind regards,
Jos
So that's one million records with 14 columns each? It depends a bit on the length
of the columns but I can see that you get an OutOfMemoryError ... there are a
few -X flags that increase the JVM's heap size but I think that's just postponing
the execution. What do you want to load that many records in memory at once?
kind regards,
Jos
Thanks for ur response Jos.
I need to import data from one database to another database. Please give me some way to avoid this Outof Memory error.
Regards,
Vinod
Thanks for ur response Jos.
I need to import data from one database to another database. Please give me some way to avoid this Outof Memory error.
Regards,
Vinod
You might try to specify the Statement.setFetchSize() on your Statement
kind regards,
Jos
You might try to specify the Statement.setFetchSize() on your Statement
kind regards,
Jos
I have tried this setFetchSize() method. But I got error message(Invalid fetch size).
Thanks,
Vinod
I have tried this setFetchSize() method. But I got error message(Invalid fetch size).
Thanks,
Vinod
So what happens if you experiment a bit with different fetch sizes?
kind regards,
Jos
So what happens if you experiment a bit with different fetch sizes?
kind regards,
Jos
Hi,
I got the following error.
rs.setFetchSize(50);
java.sql.SQLException: Invalid Fetch Size
Thanks,
Vinod
Hi,
I got the following error.
rs.setFetchSize(50);
java.sql.SQLException: Invalid Fetch Size
Thanks,
Vinod
Can you show us a bit of relevant code please? What database are you using?
kind regards,
Jos
Hi
The ResultSet is having a limit of 1000 results. You can not access unlimited number of records from a singlr sql query. So you are getting errors
The ResultSet is having a limit of 1000 results.
That all depends on the database vendor and its JDBC driver.
kind regards,
Jos
That all depends on the database vendor and its JDBC driver.
kind regards,
Jos
Hi,
I have tried to read 3,00,000 records. I was able to do this.
Please advise. Is any other way to perform this.
Thanks,
Vinod
Hi,
I have tried to read 3,00,000 records. I was able to do this.
Please advise. Is any other way to perform this.
Thanks,
Vinod
I don't know if you followed an other identical thread but my observations are:
1) users are not willing to scroll through so much data. They want it in reasonable
chunks through which they can navigate.
2) you can't collect that much database because of memory constraints.
So my tip is to 'page' through all the data. Depending on your database and its
SQL dialect you might check the 'offset/limit' statement parts or the 'numrows'
statement part or whatever your database supports.
A few buttons for navigational purposes and just a bit of data in the Session
object can do the rest. Don't try to retrieve and show all the data in one piece.
kind regards,
Jos
I don't know if you followed an other identical thread but my observations are:
1) users are not willing to scroll through so much data. They want it in reasonable
chunks through which they can navigate.
2) you can't collect that much database because of memory constraints.
So my tip is to 'page' through all the data. Depending on your database and its
SQL dialect you might check the 'offset/limit' statement parts or the 'numrows'
statement part or whatever your database supports.
A few buttons for navigational purposes and just a bit of data in the Session
object can do the rest. Don't try to retrieve and show all the data in one piece.
kind regards,
Jos
thanks Jos. Let me try
vinod
Please use this this will help you in storing the bulk data without memory dependency
Statement stmt = con.createStatement(java.sql.ResultSet.TYPE_FORWAR D_ONLY,java.sql.ResultSet.CONCUR_READ_ONLY);
stmt.setFetchSize(Integer.MIN_VALUE);
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Steve |
last post by:
Hi,
I have a web application where there are a number of columns a user can
sort on (price, item etc). The database itself is HUGE (around 6 million
rows) and even with all the indexing it slows...
|
by: Rainer Collet |
last post by:
hi!
i tested several php database abstraction layers (db, mdb(2), creole,
adodb, etc), but i always missed one really important feature:
i need a method for a limited select which gives me the...
|
by: RoyalScorpion |
last post by:
hi guys, i get an updatable resultset from a connection then used it
to insert a new row but the result set doesn't chane after insertion,
i mean the no of rows before insertion is the same after...
|
by: Karam Chand |
last post by:
Greetings
I have a table with the following table structure -
Field Type Collation Null Key
Default Extra
------- ------------- ----------------- ------
------ ...
|
by: Karam Chand |
last post by:
Greetings
I have a table with the following table structure -
Field Type Collation Null Key
Default Extra
------- ------------- ----------------- ------
------ ...
|
by: _link98 |
last post by:
Problem: java ResultSet cursor from SQL/PL stored-procedure is
FORWARD_ONLY.
Is it possible to have ResultSet cursors from SQL/PL procedures to
scroll forward and backwards? Perhaps I am missing...
|
by: natG |
last post by:
Hi;
In db2 8.2, how do I limit a query resultset to x rows?
Thanks,
nat
|
by: Garth Wells |
last post by:
I use a filtered SELECT to populate the SQLDataReader (rdr) with
a filename and a blob (pdf). I then use File.WriteAllBytes to write
each pdf to disk.
----------------------------------------...
|
by: Sl1ver |
last post by:
That is my code, if i put a updateQuery statement in there, then it updates my database, but when i query the database then it doesn't populate the resultset
public ResultSet User(String user)
...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |