Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

retrieve data from mysql in java slow when there is large data

843859Feb 25 2008 — edited Jan 14 2015
My program need to store the data and then retrieve it to do some processing. When i have around 10,000 rows inside my table, it works fast, around 2 sec and i'll get my result for both storing and retrieving. This works fast even i have select 5000 data from it.

Problem:
I have a large data, around 300,000 rows inside a table.

I'm using the following code

resultset1 = statement.executeQuery {
" Select 'attribute' from 'table' where ....
}

When i'm trying to select around 2000 rows data from 300,000 rows, this takes me quite long time, is there any other method to speed up my retrieving?

I've just solved my storing those data into my table by using : Load data infile

Really appreciate any of your help which can speed up the retrieving data.

Best Regards,
Kar Hong
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 25 2008
Added on Feb 25 2008
4 comments
550 views