DBSubset oCalendarsByState = new DBSubset(DB.k_working_calendar + " c",
oWCal.getTable(oConn).getColumnsStr()+", NULL AS "+DB.nm_state,
DB.gu_workarea+"=? AND "+DB.id_domain+"=? AND "+
DB.id_country+"=? AND "+DB.id_state+" IS NOT NULL", 50);
int nCals = oCalendarsByState.load(oConn, new Object[]{new Integer(iDomainId),sWorkAreaId,sCountryId});
PreparedStatement oStmt = oConn.prepareStatement("SELECT "+DB.nm_state+" FROM "+DB.k_lu_states+" WHERE "+DB.id_country+"='"+sCountryId+"' AND "+DB.id_state+"=?",
ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
for (int c=0; c<nCals; c++) {
oStmt.setString(1, oCalendarsByState.getString(DB.id_state,c));
ResultSet oRSet = oStmt.executeQuery();