실제 동작시키니 에러가 떳다...
------------------------------------------------------------------------------------------
<insert id="abcinsert" parameterClass="abcDTO">
<![CDATA[
if not exists(select * from schedule_info_tbl where convert(datetime, scDate,120) = convert(datetime, #scDate#,120))
begin
insert into schedule_info_tbl($objName$,scDate,position)
values(#textVal#, convert(datetime, #scDate#,120), #position#)
end
else
begin
update schedule_info_tbl
set $objName$ = #textVal#,
position = #position#
where convert(datetime, scDate,120) = convert(datetime, #scDate#,120)
end
]]>
</insert>
------------------------------------------------------------------------------------------
요 <insert> 이걸로 쓰는데 에러가 났다...
----------에러메세지--------
com.ibatis.dao.client.DaoException: Failed to execute queryForObject - id [scheduleSave], parameterObject [schedule.dto.ScheduleDTO@2ac57c]. Cause: java.sql.SQLException: Insert statements cannot be executed as a query.
Caused by: java.sql.SQLException: Insert statements cannot be executed as a query.
봤더니 dao쪽에 아무생각없이queryForObject를 썼는데 이게 다른건 상관없지만
xml에 <insert>로 선언하고 내용에 위에처럼 insert도 있고update도 있으면 에러가 나온다.
그래서 dao에 queryForObject대신
this.insert("abcInsert",abcDTO); <== 이렇게 바꾸니까 된다ㅎㅎㅎ
'아이폰어플' 카테고리의 다른 글
아이폰으로 Ftp서버/클라이언트로 사용해보자! (1) | 2010.03.15 |
---|---|
아이폰에서 웹하드에 있는 자료를 이용해보자(2ndrive) (2) | 2010.03.08 |
아이폰게임어플-hysteria project(공포게임-오늘만무료 어플) (0) | 2010.02.24 |
아이폰게임어플-이노티아1(legend of feanor) (2) | 2010.02.23 |
아이폰게임어플-트랙&필드(올림픽5종경기) (0) | 2010.02.19 |