`
kimnin
  • 浏览: 10672 次
  • 性别: Icon_minigender_1
  • 来自: 合肥
社区版块
存档分类
最新评论

ibatis oracle 长字符串 bug

    博客分类:
  • JAVA
阅读更多

ibatis : ibatis-2.3.4.726.jar
<update id="update" parameterClass="org.kimnin.test4000.Test4000PO">
        update test4000 set str=#str#    where id=#id#
</update>

<insert id="insert" parameterClass="org.kimnin.test4000.Test4000PO">
        insert into test4000(id ,str)values( #id# ,#str#)
</insert>

   public void test4000insert() throws Throwable {
      Test4000PO test = new Test4000PO();
      test.setId(3);
      test.setStr(_1000 + _1000 + _1000 + _1000);//_1000是长度为1k的的字符串
      System.out.println(test.getStr().length());
      sqlMap.insert("insert", test);
   }
  
   public void test4000update() throws Throwable {
      Test4000PO test = new Test4000PO();
      test.setId(2);
      test.setStr(_1000 + _1000 + _1000 + _1000);
      System.out.println(test.getStr().length());
      sqlMap.update("update", test);
   }
  
在Oranxo-3.00.01.jar
<property name="JDBC.Driver" value="com.inet.ora.OraDriver" />
<property name="JDBC.ConnectionURL" value="jdbc:inetora:10.224.56.42:1521:webdb" />
           
在驱动为:
Oranxo-3.00.01.jar
使用配置文件:
<property name="JDBC.Driver" value="com.inet.ora.OraDriver" />
<property name="JDBC.ConnectionURL" value="jdbc:inetora:10.224.56.42:1521:webdb" />
insert 成功
update 失败

在驱动为:
Oranxo-3.00.01.jar
使用jdbc方式:
insert 成功
update 成功                   

在驱动为:
ojdbc14.jar
orai18n.jar
使用配置文件:
<property name="JDBC.Driver" value="oracle.jdbc.driver.OracleDriver" />
<property name="JDBC.ConnectionURL" value="jdbc:oracle:thin:@10.224.56.42:1521:webdb" />
insert 成功
update 成功                   

Mysql环境下使用配置文件:
<property name="JDBC.Driver" value="com.mysql.jdbc.Driver" />
<property name="JDBC.ConnectionURL" value="jdbc:mysql://localhost/test" />
insert 成功
update 成功


结论
iBATIES在使用Oranxo-3.00.01.jar配合上有问题.
有可能是调用驱动,实现update功能时,调用方式不对导致update在字符串长度为大于1333个时出现问题。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics