Re: OutOfMemoryException
Hi All,
I am retrieving the values fromt he database using the
SpringFramework.
In SpringFramework we have an execute method which returns the list and
the query whcih we pass to the execute method returns 45k records
The code where i am getting out of memory is pasted below
String slSelectAdministradores = " SELECT codigo_administrador
codigo,"
+ " razon_social descripcion,"
+ " clase_documento,identificacion,"
+ " estado_administrador estado"
+ " FROM administradores noholdlock"
+ " WHERE razon_social >= ? and"
+ " razon_social <= ? ";
SelectAdministradore objSelectAdministradore = new
SelectAdministradore(dscDataSource, slSelectAdministradores);
objSelectAdministradore.declareParameter(new
SqlParameter(Types.VARCHAR));
objSelectAdministradore.declareParameter(new
SqlParameter(Types.VARCHAR));
Object[] oalAdministradore = new Object[] {
nombreInicial, nombreFinal };
objSelectAdministradore.compile();
List li1 = objSelectAdministradore.execute(oalAdministradore);
/**
* Inner Class
*
*/
class SelectAdministradore extends MappingSqlQuery {
CodDescripcionObj obj;
SelectAdministradore(DataSource dsaDataSource,
String saSelectAdministradores) {
super(dsaDataSource, saSelectAdministradores);
}
protected Object mapRow(ResultSet rs, int pRowNum) throws
SQLException {
obj = new CodDescripcionObj();
obj.setCodigo(rs.getString("codigo"));
obj.setDescripcion(rs.getString("descripcion"));
obj.setClase_documento(rs.getString("clase_documento"));
obj.setIdentificacion(rs.getString("identificacion"));
obj.setEstado(rs.getInt("estado"));
return obj;
}
}
srinivas.veeranki@gmail.com wrote:
Hi All,
While I am retrieving from the data base I am getting more than 45k
Records. I am unable to stored all those records in to the List. Here I
am getting OutOfMemoryException. How Can i store all those records in
the List.
Regards,
Srinivas.