I am getting this error:
Exception in thread \"main\" java.lang.OutOfMemoryError: Java heap space at com.mysql.jdbc.MysqlIO.nextRowFast(MysqlIO.java:1585
Try splitting your data into a number of result sets. Think about what you want to do with the data once you got it back from the database. The result set is too large to fit in heap space.