java.sql.SQLException: Invalid column index
היי, אני מנסה לקבל מערך של אובייקטים מהסוג KpiInstanceDt (אובייקט שלי). את המערך אני רוצה לקבל ע"י מיפוי של השאילתא לאובייקט שממפה לי בין האובייקט שלי לבין תוצאות השאילתא. KpiInstanceDtMapper אני ממריצה את השאילתא באורקל עצמו ומקבלת תוצאות, העניין שדרך ג'אווה אני מקבלת את השגיאה הבאה:
היי, אני מנסה לקבל מערך של אובייקטים מהסוג KpiInstanceDt (אובייקט שלי). את המערך אני רוצה לקבל ע"י מיפוי של השאילתא לאובייקט שממפה לי בין האובייקט שלי לבין תוצאות השאילתא. KpiInstanceDtMapper אני ממריצה את השאילתא באורקל עצמו ומקבלת תוצאות, העניין שדרך ג'אווה אני מקבלת את השגיאה הבאה:
//this is my code: Object[] args = new Object[]{teamId,projetcId,version,visibleForSuper,visibleForAgent}; try { metaDataList = (List) getJdbcTemplate().query(KpiMetaDataSqlQuery.SELECT_KPI_INSTANCES_FOR_TEAM_AGENT,args, new RowMapperResultSetExtractor( new KpiInstanceDtMapper())); //select ki.indx,ki.id,ki.display_name,ki.description,calculation_formula_id,display_mask_id,threshold1,threshold2,threshold3,threshold4,ascending,current_time_frame_id,current_time_count,history_time_frame_id,history_time_count,measure_unit_id,show_team,visible_for_agent,visible_for_super,csets.id as cs_id from kpi_instances ki,cs_teams cst, content_sets csets, deployed_projects dp where ki.cs_indx = cst.cs_indx and cst.TEAM_ID = 'team_1' and cst.cs_indx = csets.indx and csets.PROJECT_INDX = dp.indx and dp.project_id = 'Project_1' and dp.version = 1 and visible_for_agent = 1; }catch(Exception ex) { ex.printStackTrace(); } //I have this class: private class KpiInstanceDtMapper implements RowMapper { public Object mapRow(ResultSet rs, int rowNum) throws SQLException { KpiInstanceDt kpiInstanceDt = new KpiInstanceDtImpl(); if(rs.next()){ kpiInstanceDt.setIndx(rs.getLong("ki.indx")); kpiInstanceDt.setCsIndx(rs.getLong("cs_indx")); kpiInstanceDt.setCsId(rs.getString("ki.cs_id")); kpiInstanceDt.setId(rs.getString("ki.id")); kpiInstanceDt.setDisplayName(rs.getString("ki.display_name")); kpiInstanceDt.setDescription(rs.getString("ki.description")); kpiInstanceDt.setCalculationFormulaId(rs.getShort("calculation_formula_id")); kpiInstanceDt.setDisplayMaskId(rs.getShort("display_mask_id")); kpiInstanceDt.setThreshold1(rs.getDouble("threshold1")); kpiInstanceDt.setThreshold2(rs.getDouble("threshold2")); kpiInstanceDt.setThreshold3(rs.getDouble("threshold3")); kpiInstanceDt.setThreshold4(rs.getDouble("threshold4")); kpiInstanceDt.setAscending(rs.getBoolean("ascending")); kpiInstanceDt.setCurrentTimeFrameId(rs.getShort("current_time_frame_id")); kpiInstanceDt.setCurrentTimeCount(rs.getLong("current_time_count")); kpiInstanceDt.setHistoryTimeFrameId(rs.getShort("history_time_frame_id")); kpiInstanceDt.setHistoryTimeCount(rs.getLong("history_time_count")); kpiInstanceDt.setMeasureUnitId(rs.getShort("measure_unit_id")); kpiInstanceDt.setShowTeam(rs.getBoolean("show_team")); kpiInstanceDt.setShowHistory(rs.getBoolean("show_history")); kpiInstanceDt.setVisibleForAgent(rs.getBoolean("visible_for_agent")); kpiInstanceDt.setVisibleForSuper(rs.getBoolean("visible_for_super")); }else { kpiInstanceDt= null; } return kpiInstanceDt; } }
אני מקווה שמישהו יוכל לעזור לי.. אני ממש תקועה עם זה, המון תודה מראש והמשך ערב מהמם, יעל.