ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "AVenkatesan" <AVenkate...@ceiindia.com>
Subject Mysql Database not showing the inserted record
Date Thu, 13 Dec 2007 04:58:59 GMT
iam trying to run a simple ibatis insert statement as follows:

I have code as following
 try{
        SqlMapSession sqlMapSession= sqlMapClient.openSession();
        sqlMapSession.startTransaction();
        int i=sqlMapSession.update("insertCode",code);
        
        sqlMapSession.commitTransaction();
        sqlMapSession.close();
}catch{.....}

but after excuting the program i see insert statement in logs but the inserted records are
not visible in database.

Following is the Code.xml
<sqlMap namespace="Code">
  <resultMap id="result" class="transferobjects.com.Code">
        <result property="codeId" column="CODE_ID"/>
        <result property="codeDetails" column="CODE_DETAILS"/>
        <result property="codeDomain" column="CODE_DOMAIN"/>
        <result property="empId" column="EMP_ID"/>
    </resultMap>

    <insert id="insertCode">
        insert into CI_CODE (CODE_ID,CODE_DETAILS,CODE_DOMAIN,EMP_ID) values 
        (#codeId#, #codeDetails#,#codeDomain#,#empId#)
    </insert


</sqlMap>

And resective sql-map-config.xml as 
<sqlMapConfig>

 
        <sqlMap resource="com/codeinnovation/ibatis/Code.xml"/>
        

</sqlMapConfig>

Anything wrong with the code?

Venkatesan
Mime
View raw message