Hi,
I am getting
Java Heap space error while adding database resultset to Hashmap, below is the method i am using in my application, kindly suggest how can i resolve this issue
private HashMap<
String, String> loadOrganiztionMapping(Connection smDbConn) {
Statement stmnt = null;
HashMap<String,String> map = null;
try{
map = new HashMap<String,String>();
stmnt = smDbConn.createStatement();
ResultSet rs1 = stmnt.executeQuery("SELECT org_id, org_code FROM bms_organization");
while(rs1.next()){
map.put(rs1.getString("org_code"), rs1.getString("org_id"));
}
rs1.close();
}
catch(Exception e){
log.error(MobilyException.getStackTraceAsString(e));
}
finally {
if(stmnt != null){
try {
stmnt.close();
} catch (SQLException e) {
log.error(MobilyException.getStackTraceAsString(e));
}
}
}
return map;
}