2012-12-21 117 views
0

我是JDBC中的noob,iBatis。我試圖讓我的Java EE應用程序在sql服務器上執行一個存儲過程,但服務器拋出了一個奇怪的錯誤,這對我來說沒有任何意義。有人能幫助我理解我做錯了什麼。無法理解此jdbc,ibatis錯誤

這是錯誤:

20121221 18:42:38:960 [CONFERENCE] INFO 320 AppController    - Error : Error Occurred while Speakers List data retrival: SqlMapClient operation; bad SQL grammar []; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException: 
--- The error occurred in com/ABCD/conference/model/Conference.xml. 
--- The error occurred while applying a parameter map. 
--- Check the conference_get_speakers-InlineParameterMap. 
--- Check the statement (update procedure failed). 
--- Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Could not find stored procedure 'imconference..conference_get_speakers'. 
20121221 18:42:38:960 [CONFERENCE] INFO 323 AppController    - handleException >> 

下面是在XML文件中的映射:

<resultMap id="result-speakers" class="com.jpmorgan.conference.model.Attendee"> 
    <result property="confId" column="conf_Id" />  
    <result property="attendeeId" column="attendee_id" /> 
    <result property="firstName" column="first_name" /> 
    <result property="lastName" column="last_name" /> 
</resultMap> 
<procedure id="getSpeakers" resultMap="result-speakers"> 
    {call 
    imconference..get_speakers_details(#confId#)} 
</procedure>     
<procedure id="conference_get_speakers" resultMap="result-speakers"> 
    {call   
    imconference..conference_get_speakers(#confId#)} 
</procedure> 

我能夠在數據庫上執行獨立的存儲過程。我想我在映射xml文件時犯了一個錯誤。任何幫助,想法將不勝感激。如果您需要更多信息,請告訴我。

+0

你確定你需要'imconference..conference_get_speakers'中的雙點嗎? –

回答

0

指示如何調用存儲過程的一般形式應具有以下形式。

{call dbname.procname(#param#} 

因爲我可以看到,從你的句子中刪除一個點應該做的魔術。