首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

IBatis调用ORACLE的存储过程、函数的回来结果集例子

2013-03-26 
IBatis调用ORACLE的存储过程、函数的返回结果集例子数据库方面:定义程序包,该程序包中声名了存储过程和函数

IBatis调用ORACLE的存储过程、函数的返回结果集例子
数据库方面:定义程序包,该程序包中声名了存储过程和函数



测试执行类
@SuppressWarnings("unchecked")public static void main(String[] args) {//存储过程的调用//IStudentDAO dao = new IStudentDAOImpl();////Map parameterMap = new HashMap();//parameterMap.put("s_id", 0);//List<Student> accoutList = dao.queryPkgProStudentList(parameterMap);//if(accoutList.size()>0){//for(Student temp:accoutList){//if(temp!=null){//System.out.println(temp.getBirth().toLocaleString()+"---"+temp.getMajor());//}//}//}//System.out.println("-------------------------");//System.out.println("size:"+accoutList.size());//函数的调用IStudentDAO dao = new IStudentDAOImpl();Map parameterMap = new HashMap();parameterMap.put("s_id", 0);List<Student> accoutList = dao.queryFunStudentList(parameterMap);if(accoutList.size()>0){for(Student temp:accoutList){if(temp!=null){System.out.println(temp.getBirth().toLocaleString()+"---"+temp.getMajor());}}}System.out.println("-------------------------");System.out.println("size:"+accoutList.size());}@Overridepublic List queryFunStudentList(Map parameterMap) {List result = null;try {result = sqlMapClient.queryForList("fun_stu_cursor",parameterMap);System.out.println("size:"+result.size());} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();}return result;}@Overridepublic List queryPkgProStudentList(Map parameterMap) {// TODO Auto-generated method stubList result = null;try {result = sqlMapClient.queryForList("pkgPro_stu_cursor",parameterMap);} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();}return result;}

我的异常网推荐解决方案:oracle存储过程,http://www.myexception.cn/oracle-develop/177537.html

热点排行