Best Regards, Zhang Bin
----- 转发邮件 ---- 发件人: 张彬 <[EMAIL PROTECTED]> 收件人: user-java@ibatis.apache.org 已发送: 2007/2/1(周四), 下午6:05:07 主题: about invoke procedure error Hi, I am new to ibatis. My enviroment is Oracle+Java+ibatis. I write a sample to invoke Oracle procedure. But error occured. Can you help me? Thanks. The following is error log: com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in com/cumquatit/examples/ibatis/refs/Ref.xml. --- The error occurred while applying a parameter map. --- Check the procParamMap. --- Check the output parameters (retrieval of output parameters failed). --- Cause: java.lang.NullPointerException Caused by: java.lang.NullPointerException at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:184) at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForObject(GeneralStatement.java:100) at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:561) at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:536) at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:97) at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:69) at com.cumquatit.examples.ibatis.refs.RefTester.main(RefTester.java:35) ============================================================================== The ddl is : create table CSCUSTOM ( CUSTID number(12) primary key, CUSTSTATDATE date, NAME VARCHAR2(20)); CREATE SEQUENCE custom_id_seq increment by 1 start with 1; The sqlmap file is : <sqlMap> <parameterMap id="procParamMap" class="java.util.HashMap"> <parameter property="v_Names" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN" /> <parameter property="v_Values" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN" /> <parameter property="v_Id" jdbcType="INTEGER" javaType="java.lang.Integer" mode="OUT"/> </parameterMap> <procedure id="procTest" parameterMap="procParamMap">{call proInsertCustInfo (?,?,?)}</procedure> </sqlMap> The source file is : String resource; Reader reader; SqlMapClient sqlMap; resource = "com/cumquatit/examples/ibatis/refs/SqlMapConfig.xml"; reader = Resources.getResourceAsReader(resource); sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader); Map map = new HashMap(); map.put("v_Names", "1"); map.put("v_Values", String.valueOf(System.currentTimeMillis())); map.put("v_Id", "1"); HashMap object = (HashMap) sqlMap.queryForObject("procTest", map); System.out.println(object.get("v_Id")); Best Regards, Zhang Bin ___________________________________________________________ 抢注雅虎免费邮箱-3.5G容量,20M附件! http://cn.mail.yahoo.com ___________________________________________________________ 雅虎免费邮箱-3.5G容量,20M附件 http://cn.mail.yahoo.com/