2016-04-11 14 views
1

Birisi elses uygulamasında bir olayı çözmek için atandım.Saklı yordamla çağrıdan özel durum iBATIS

Ancak, uygulama iBATIS ile bir sqlMap ve Stored yordamı kullanır ve ben daha önce hiç bununla çalışmadım.

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(); 
    } 
} 

// sqlmap xml dosyasında bu durum yaşıyorum

<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) 

Hatta anlamıyorum

Bu

Bugüne kadar ne var Bu bölümün anlamı:

CREATEITEM in * N type * N bulunamadı.

* N ne anlama geliyor?

Saklı yordamları nerede bulabilirim? CREATEITEM, uygulama dosyalarında başka hiçbir yerde bulunamaz mı?

Thnx

cevap

0

saklı yordam veritabanında olup, bir veritabanı istemcisi ile veritabanına bağlanmak ve saklı yordam kodunu kontrol etmek zorunda (belki de PL/SQL kodu).

"CREATEITEM in * N type * N bulunamadı." belki saklı yordamın dönüş tipi neden olur. Bir tam sayı olduğundan emin misin?

+0

Cevabınız için teşekkür ederiz. BT departmanındaki birisi saklanmış tüm prosedürlerimizi silmeyi başarmıştı. Bu istisnanın sebebi ve neden hiçbir yerde bulamadım. Neyse ki yakın zamanda bir yedeğimiz vardı ve şimdi hepsi çözüldü. –

+0

İyi! Sorun çözüldü! ;) – TeoVr81