ibatis 访问orcale中的存储过程出错,向高手请教

joygxd 2005-05-08 06:15:02
xml配置

<resultMap id="getAllotType" class="com.szjz.goldf.allot.dao.bean.AllotType">
<result property="id" column="BILLTYPEID" columnIndex="1"/>
<result property="allotTypeName" column="BILLTYPENAME" columnIndex="2"/>
<result property="allotTypeAlias" column="BILLTYPEALIAS" columnIndex="3"/>
</resultMap>

<parameterMap id="get_result" class="com.szjz.goldf.allot.dao.bean.AllotType">
<parameter property="result" mode="OUT" jdbcType="ORACLECURSOR"
javaType="java.lang.Object"/>
</parameterMap>

<procedure id="getSpList" parameterMap="get_result" resultMap="getAllotType">
{call efm.sp_getAllotTypeList(?)}
</procedure>

调用代码
public List findAllotTypeList()
{
return getSqlMapClientTemplate().queryForList("getSpList",null);
}

错误日志

2005-05-08 18:00:45,690 WARN struts.action.RequestProcessor:538 -> Unhandled Exception thrown: class org.springframework.jdbc.UncategorizedSQLException

StandardWrapperValve[action]: Servlet.service() for servlet action threw exception

org.springframework.jdbc.UncategorizedSQLException: (SqlMapClient operation): encountered SQLException [
--- The error occurred in com/szjz/goldf/allot/dao/bean/AllotType.xml.
--- The error occurred while preparing the mapped statement for execution.
--- Check the getSpList.
--- Check the parameter map.
--- Cause: java.lang.NullPointerException]; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/szjz/goldf/allot/dao/bean/AllotType.xml.
--- The error occurred while preparing the mapped statement for execution.
--- Check the getSpList.
--- Check the parameter map.
--- Cause: java.lang.NullPointerException

org.springframework.jdbc.UncategorizedSQLException: (SqlMapClient operation): encountered SQLException [
--- The error occurred in com/szjz/goldf/allot/dao/bean/AllotType.xml.
--- The error occurred while preparing the mapped statement for execution.
--- Check the getSpList.
--- Check the parameter map.
--- Cause: java.lang.NullPointerException]; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/szjz/goldf/allot/dao/bean/AllotType.xml.
--- The error occurred while preparing the mapped statement for execution.
--- Check the getSpList.
--- Check the parameter map.
--- Cause: java.lang.NullPointerException

com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/szjz/goldf/allot/dao/bean/AllotType.xml.
--- The error occurred while preparing the mapped statement for execution.
--- Check the getSpList.
--- Check the parameter map.
--- Cause: java.lang.NullPointerException
...全文
209 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
theoffspring 2005-05-13
  • 打赏
  • 举报
回复
请问,这些错误信息是如何写到日志里的,是在catch语句里写的吗,我现在正在学习ibatis,发现无法调试它。不知道错在哪里。
ipqitfk 2005-05-12
  • 打赏
  • 举报
回复
有很多错误,指出几个一眼就发现的错误
1。public List findAllotTypeList()
{
return getSqlMapClientTemplate().queryForList("getSpList",null);
}
如果不传参数进去,parameterMap="get_result" 是多余的,这就是log里让你--- Check the parameter map. 的原因

2。Check the getSpList. 原因是你查出来的字段resultMap未定义,这是很多人犯的错误。
3org.springframework.jdbc.UncategorizedSQLException
可能你存储过程的写法是有问题,先调试一下,再放到ibatis里来
joygxd 2005-05-12
  • 打赏
  • 举报
回复
存储过程都是好的,我都调试过的。

还有我得到是一个返回的结果集。所以用了parameterMap="get_result"。

你可以发给一个成功的配置例子吗,关于返回结果集的?

joygxd@163.com
joygxd 2005-05-10
  • 打赏
  • 举报
回复
有人指点吗,感激不尽呀
joygxd 2005-05-09
  • 打赏
  • 举报
回复
有人指点吗,感激不尽呀
joygxd 2005-05-08
  • 打赏
  • 举报
回复
有人指点吗,感激不尽呀
mbl 2005-05-08
  • 打赏
  • 举报
回复
不会帮你顶

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧