[英]Exception from call with stored procedure iBATIS
我被分配到某個elses應用程序解決事件。
但是,應用程序使用sqlMap和存儲過程與iBATIS,我以前從未使用過。
這是我到目前為止:
public void createItemInDb() {
try {
System.out.println("status: " + this.getStatus());
System.out.println("weight: " + this.getWeight());
System.out.println("node name: " + this.getNodeName());
System.out.println("node ui: " + this.getNodeUi());
SqlMapClient sqlMap = AppSqlMapClient.getSqlMapInstance();
sqlMap.queryForObject("createItem", this);
} catch (SQLException e) {
e.printStackTrace();
}
}
// xml文件中的sqlMap
<parameterMap class="item" id="createItemMap">
<parameter property="nodeName" jdbcType="VARCHAR" mode="IN" />
<parameter property="status" jdbcType="INTEGER" mode="IN" />
<parameter property="weight" jdbcType="INTEGER" mode="IN" />
<parameter property="nodeUi" jdbcType="INTEGER" mode="INOUT" />
</parameterMap>
<procedure id="createItem" parameterMap="createItemMap">
{call CREATEITEM (?,?,?,?)}
</procedure>
我有這個例外:
--- The error occurred while executing query procedure.
--- Check the {call CREATEITEM (?,?,?,?)}.
--- Check the SQL Statement (preparation failed).
--- Cause: java.sql.SQLException: [SQL0204] CREATEITEM in *N type *N not found.
Caused by: java.sql.SQLException: [SQL0204] CREATEITEM in *N type *N not found.
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:185)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForObject(GeneralStatement.java:104)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:565)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:540)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:106)
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:84)
我甚至不明白這部分意味着什么:
未找到* N類型* N的CREATEITEM。
* N代表什么?
我在哪里可以找到存儲過程? 在其他地方的應用程序文件中找不到CREATEITEM?
日Thnx
存儲過程在數據庫中,您必須使用數據庫客戶端連接到數據庫並檢查存儲過程的代碼(可能是PL / SQL代碼)。
錯誤“未找到* N類型* N中的CREATEITEM”。 可能是由存儲過程的返回類型引起的。 你確定它是一個整數嗎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.