ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ravi Sundaar" <rsund...@hotmail.com>
Subject RE: Problem with stored procedure and resultMap or resultClass?
Date Fri, 03 Jun 2005 12:48:06 GMT
<html><div style='background-color:'><DIV class=RTE>
<P>Actually, I did use "casefileId" and not "@casefileId" - using "@casefileId" was
one of my desperate attempts after trying so many different things. The result is the same,
nevertheless...</P>
<P>Thanks for the suggestion anyway.</P>
<P>Any other thoughts?</P>
<P>Ravi.<BR><BR></P><BR><BR><BR>&gt;From: "Niels
Beekman" &lt;niels@wis.nl&gt;<BR>&gt;Reply-To: ibatis-user-java@incubator.apache.org<BR>&gt;To:
&lt;ibatis-user-java@incubator.apache.org&gt;<BR>&gt;Subject: RE: Problem
with stored procedure and resultMap or resultClass?<BR>&gt;Date: Fri, 3 Jun 2005
13:06:57 +0200<BR>&gt;<BR>&gt;Maybe because you are putting a '@casefileId'
in your parameterName? Try using 'casefileId'.<BR>&gt;<BR>&gt;Hope this
helps,<BR>&gt;<BR>&gt;Niels<BR>&gt;<BR>&gt;________________________________________<BR>&gt;From:
Ravi Sundaar [mailto:rsundaar@hotmail.com]<BR>&gt;Sent: vrijdag 3 juni 2005 12:44<BR>&gt;To:
ibatis-user-java@incubator.apache.org<BR>&gt;Cc: rsundaar@hotmail.com<BR>&gt;Subject:
Problem with stored procedure and resultMap or resultClass?<BR>&gt;<BR>&gt;&nbsp;am
running into a problem accessing result sets from stored procedure using ibatis 
datamapper.<BR>&gt;My DBMS is sybase and driver is Jtds.<BR>&gt;Here is
the sqlmap:<BR>&gt;&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;<BR>&gt;&lt;!DOCTYPE
sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd"&gt;<BR>&gt;&lt;sqlMap
namespace="PropAssessmentNameSpace"&gt;<BR>&gt;&lt;!-- &lt;typeAlias
alias="assessment" type="PropAssessment"/&gt; --&gt;<BR>&gt;&lt;resultMap
id="propAssessmentResult" class="PropAssessment"&gt;<BR>&gt;&lt;result property="rptdPropStrAddr"
column="RptdPropStrAddr" nullValue=""/&gt;<BR>&gt;&lt;/resultMap&gt;<BR>&gt;&lt;parameterMap
id="PropAssessmentParamMap" class="java.util.HashMap" &gt;<BR>&gt;&lt;parameter
property="casefileId" jdbcType="VARCHAR"<BR>&gt;javaType="java.lang.String" mode="IN"/&gt;<BR>&gt;&lt;/parameterMap&gt;<BR>&gt;&lt;procedure
id="stpRtrvPropAssessmtId" 
parameterMap="PropAssessmentParamMap" resultClass="PropAssessment"&gt;<BR>&gt;{call
stpRtrvPropAssessmt (?)}<BR>&gt;<BR>&gt;&lt;/procedure&gt;<BR>&gt;&lt;/sqlMap&gt;<BR>&gt;______________________________________________<BR>&gt;The
code snippet that invokes the procedure is below:<BR>&gt;HashMap paramMap = new
HashMap();<BR>&gt;paramMap.put("@casefileId", "ravi4");<BR>&gt;DataSource
ds = sqlMap.getDataSource();<BR>&gt;sqlMap.setUserConnection(conn);<BR>&gt;sqlMap.queryForObject("stpRtrvPropAssessmtId",
paramMap);<BR>&gt;When I execute the stored procedure in isql mode, with "ravi4"
as the input param, it gives me one row as the result set.<BR>&gt;____________________________________________________<BR>&gt;Here
is the stack trace and log from executing the procedure through ibatis:<BR>&gt;DEBUG
06-02 10:53:34<BR>&gt;Unknown macro:<BR>&gt;Unknown macro: {conn-100000}<BR>&gt;Connection

(ConnectionLogProxy.java:42)<BR>&gt;DEBUG 06-02 10:53:34<BR>&gt;Unknown
macro:<BR>&gt;Unknown macro: {pstm-100001}<BR>&gt;PreparedStatement: (PreparedStatementLogProxy.java:48)<BR>&gt;DEBUG
06-02 10:53:34<BR>&gt;Unknown macro:<BR>&gt;Unknown macro: {pstm-100001}<BR>&gt;Parameters:
[ravi4] (PreparedStatementLogProxy.java:49)<BR>&gt;DEBUG 06-02 10:53:34 Types: [java.lang.String]
(PreparedStatementLogProxy.java:50)<BR>&gt;DEBUG 06-02 10:53:34<BR>&gt;Unknown
macro: {rset-100002}<BR>&gt;ResultSet (ResultSetLogProxy.java:41)<BR>&gt;com.ibatis.common.jdbc.exception.NestedSQLException:<BR>&gt;-
The error occurred in config/PropAssessment.xml.<BR>&gt;- The error occurred while
applying a parameter map.<BR>&gt;- Check the PropAssessmentNameSpace.PropAssessmentParamMap.<BR>&gt;-
Check the results (failed to retrieve results).<BR>&gt;- Cause: java.lang.NullPointerException<BR>&gt;Caused
by: 
java.lang.NullPointerException<BR>&gt;at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:184)<BR>&gt;at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForObject(GeneralStatement.java:100)<BR>&gt;at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:561)<BR>&gt;at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:536)<BR>&gt;at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:97)<BR>&gt;at
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:69)<BR>&gt;at
PropAssessment.main(PropAssessment.java:266)<BR>&gt;Caused by: java.lang.NullPointerException<BR>&gt;at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<BR>&gt;at 
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)<BR>&gt;at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)<BR>&gt;at java.lang.reflect.Method.invoke(Unknown Source)<BR>&gt;at
com.ibatis.common.jdbc.logging.ResultSetLogProxy.invoke(ResultSetLogProxy.java:47)<BR>&gt;at
$Proxy2.close(Unknown Source)<BR>&gt;at com.ibatis.sqlmap.engine.execution.SqlExecutor.closeResultSet(SqlExecutor.java:392)<BR>&gt;at
com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQueryProcedure(SqlExecutor.java:298)<BR>&gt;at
com.ibatis.sqlmap.engine.mapping.statement.ProcedureStatement.sqlExecuteQuery(ProcedureStatement.java:34)<BR>&gt;at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:169)<BR>&gt;...
6 more<BR>&gt;Caused by:<BR>&gt;java.lang.NullPointerException<BR>&gt;at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)<BR>&gt;at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)<BR>&gt;at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)<BR>&gt;at java.lang.reflect.Method.invoke(Unknown
Source)<BR>&gt;at com.ibatis.common.jdbc.logging.ResultSetLogProxy.invoke(ResultSetLogProxy.java:47)<BR>&gt;at
$Proxy2.close(Unknown Source)<BR>&gt;at com.ibatis.sqlmap.engine.execution.SqlExecutor.closeResultSet(SqlExecutor.java:392)<BR>&gt;at
com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQueryProcedure(SqlExecutor.java:298)<BR>&gt;at
com.ibatis.sqlmap.engine.mapping.statement.ProcedureStatement.sqlExecuteQuery(ProcedureStatement.java:34)<BR>&gt;at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:169)<BR>&gt;at

com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForObject(GeneralStatement.java:100)<BR>&gt;at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:561)<BR>&gt;at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:536)<BR>&gt;at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:97)<BR>&gt;at
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:69)<BR>&gt;at
PropAssessment.main(PropAssessment.java:266)<BR>&gt;Caused by:<BR>&gt;java.lang.NullPointerException<BR>&gt;at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<BR>&gt;at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source)<BR>&gt;at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)<BR>&gt;at

java.lang.reflect.Method.invoke(Unknown Source)<BR>&gt;at com.ibatis.common.jdbc.logging.ResultSetLogProxy.invoke(ResultSetLogProxy.java:47)<BR>&gt;at
$Proxy2.close(Unknown Source)<BR>&gt;at com.ibatis.sqlmap.engine.execution.SqlExecutor.closeResultSet(SqlExecutor.java:392)<BR>&gt;at
com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQueryProcedure(SqlExecutor.java:298)<BR>&gt;at
com.ibatis.sqlmap.engine.mapping.statement.ProcedureStatement.sqlExecuteQuery(ProcedureStatement.java:34)<BR>&gt;at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:169)<BR>&gt;at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForObject(GeneralStatement.java:100)<BR>&gt;at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:561)<BR>&gt;at

com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:536)<BR>&gt;at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:97)<BR>&gt;at
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:69)<BR>&gt;at
PropAssessment.main(PropAssessment.java:266)<BR>&gt;Where am I going wrong?<BR>&gt;Thanks
in advance for your help!<BR>&gt;Ravi.<BR>&gt;<BR></DIV></div></html>


Mime
View raw message