Map> apps = new HashMap>();
final String APPLICATION_QUERY = EWMIG_Queries.getApplicationDetails(_instanceName);
logger.info("APPLICATION_QUERY: " + APPLICATION_QUERY);
pstmt = connection.prepareStatement(APPLICATION_QUERY, ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
rs_application = pstmt.executeQuery();
List valueObject;
while(rs_application.next()){
List appDetails = new ArrayList();
final String currentKey = rs_application.getString(EWMIG_Constants.S_KEYVALUE).trim();
final String currentApp = rs_application.getString(EWMIG_Constants.S_APPLICATION).trim();
final String currentLanguage = rs_application.getString(EWMIG_Constants.S_LANGUAGE).trim();
final String currentDesc = rs_application.getString(EWMIG_Constants.S_DESCRIPTION).trim();
String details[] = {currentApp, currentLanguage, currentDesc};
appDetails.add(details);
valueObject = apps.get(currentKey);
if (valueObject == null) {
apps.put(currentKey, appDetails);
} else {
(valueObject).add(details);
apps.put(currentKey, valueObject);
}
}
Gautocxia.com is where I leave small pieces of my mind — stories from work, travel, and music. Between lines of code and heavy riffs, there’s poetry, laughter, and reflections on life’s rhythm.
Thứ Năm, 26 tháng 10, 2023
Merge records from ResultSet
Đăng ký:
Đăng Nhận xét (Atom)
Không có nhận xét nào:
Đăng nhận xét