out of memory when reading a table
That should be a fairly standard question but I cant find the answer at he moment. I am writing a short script that exports tables to csv files. Naturally tables I have may be quite large (up to 1 G). If I just use
java tries to read the table in one piece and naturally runs out of memory. I guess I could do smthing like
SELECT * FROM tableName
in a loop but that would be 1. specific to mysql only and 2. I was wondering what is a better/standard way to get around the problem.
SELECT * FROM tableName LIMIT rowStart, rowEnd