Note that there are some explanatory texts on larger screens.

plurals
  1. POmybatis oracle procedure SYS_REFCURSOR setting parameter error
    primarykey
    data
    text
    <p>I am using spring 3 with Mybatis latest version.</p> <p>I am trying to make procedure call which returns cursor result, following is my code</p> <p>My Error is as following, any help is appreciated..</p> <pre><code>org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error updating database. Cause: java.lang.NullPointerException ### The error may involve com.comcast.triage.dao.AccountDetailDao.getAccountDetail-Inline ### The error occurred while setting parameters ### SQL: { ? = call ABC.get_acc_info(?, ?, ?, ?) } ### Cause: java.lang.NullPointerException at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:364) at $Proxy21.update(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.update(SqlSessionTemplate.java:250) </code></pre> <p>Following is dao interface</p> <pre><code>public interface AccountDetailDao { void getAccountDetail(Map&lt;String, Object&gt; parameter); } </code></pre> <p>Following is my mapper xml</p> <pre><code>&lt;mapper namespace="com.dao.AccountDetailDao"&gt; &lt;resultMap id="accountDetailResult" type="accountDetail"&gt; &lt;result property="usid" column="usid" /&gt; &lt;result property="accountNumber" column="account_number" /&gt; &lt;result property="headendInEEg" column="headend_in_eeg" /&gt; &lt;result property="customerType" column="customer_type" /&gt; &lt;result property="corp" column="corp" /&gt; &lt;/resultMap&gt; &lt;update id="getAccountDetail" parameterType="map" statementType="CALLABLE"&gt; { #{o_acc_cur,jdbcType=CURSOR,mode=OUT,resultMap=accountDetailResult,javaType=java.sql.ResultSet} = call ABC_TRI.get_acc_info(#{accountNumber,jdbcType=VARCHAR,mode=IN}, #{authGuid,jdbcType=VARCHAR,mode=IN}, #{mac,jdbcType=VARCHAR,mode=IN}, #{usid,jdbcType=VARCHAR,mode=IN}) } &lt;/update&gt; </code></pre> <p>mybatis also contains config for alias</p> <pre><code>&lt;typeAlias type="com.comcast.triage.domain.AccountDetail" alias="accountDetail"/&gt; </code></pre> <p>following is my oracle package procedure signature</p> <pre><code>PROCEDURE get_acc_info( i_account_number IN VARCHAR2, i_auth_guid IN VARCHAR2, i_mac IN VARCHAR2, i_usid IN VARCHAR2, o_acc_cur OUT SYS_REFCURSOR); </code></pre> <p>Caller test is as following</p> <pre><code>@Autowired </code></pre> <p>private AccountDetailDao accountDetailDao;</p> <p>@Test public void test() {</p> <pre><code>Map&lt;String, Object&gt; param = new HashMap&lt;String, Object&gt;(); param.put("i_account_number", null); param.put("i_auth_guid", null); param.put("i_mac", "0162014707802#0"); param.put("i_usid", null); accountDetailDao.getAccountDetail(param); Object obj =param.get("o_acc_cur"); Assert.assertTrue(true); </code></pre> <p>}</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload