3 回答
TA贡献1831条经验 获得超10个赞
您也可以使用以下之一
public List<EmployeeBean> fetchDataFromSPForRM(String sInputDate) {
List<EmployeeBean> employeeList = new ArrayList<EmployeeBean>();
Connection dbCon = null;
ResultSet data = null;
CallableStatement cstmt = null;
try {
dbCon = DBUtil.getDBConnection();
String sqlQuery = "{? = call PKG_HOLD_RELEASE.FN_RM_PDD_LIST()}";
cstmt = dbCon.prepareCall(sqlQuery);
cstmt.registerOutParameter(1, OracleTypes.CURSOR);
cstmt.execute();
data = (ResultSet) cstmt.getObject(1);
while(data.next()){
EmployeeBean employee = new EmployeeBean();
employee.setEmpID(data.getString(1));
employee.setSubBusinessUnitId((Integer)data.getObject(2));
employee.setMonthOfIncentive((Integer)data.getObject(3));
employee.setPIPStatus(data.getString(5));
employee.setInvestigationStatus(data.getString(6));
employee.setEmpStatus(data.getString(7));
employee.setPortfolioPercentage((Integer)data.getObject(8));
employee.setIncentive((Double)data.getObject(9));
employee.setTotalSysemHoldAmt((Double)data.getObject(10));
employee.setTotalManualHoldAmt((Double)data.getObject(11));
employeeList.add(employee);
}
} catch (SQLException e) {
e.printStackTrace();
}finally{
try {
if(data != null){
data.close();
data = null;
}
if(cstmt != null){
cstmt.close();
cstmt = null;
}
if(dbCon != null){
dbCon.close();
dbCon = null;
}
} catch (SQLException e) {
e.printStackTrace();
}
}
return employeeList;
}
- 3 回答
- 0 关注
- 959 浏览
添加回答
举报