You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by AVenkatesan <AV...@ceiindia.com> on 2007/12/13 05:58:59 UTC

Mysql Database not showing the inserted record

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