java.lang.OutOfMemory error when fetching records from Database
- by Nisarg Mehta
Hi All,
When I try to fetch around 20,000 records and return to ArrayList then it throws java heap space error.
JdbcTemplate select = new JdbcTemplate(dataSource);
String SQL_SELECT_XML_IRP_ADDRESS = " SELECT * FROM "+ SCHEMA +".XML_ADDRESS "+
" WHERE FILE_NAME = ? ";
Object[] parameters=new Object[] {xmlFileName};
return (ArrayList<XmlAddressDto> ) select.query(SQL_SELECT_XML_ADDRESS,
parameters,new XmAddressMapExt());
Is there any solution for this ? How should i process this effectively ?