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个时出现问题。
ibatis oracle 长字符串 bug
最新推荐文章于 2024-07-03 22:24:10 发布
本文探讨了iBATIS在使用不同数据库驱动时的插入与更新操作表现,特别是在使用Oranxo-3.00.01.jar驱动时,发现update操作在特定条件下失败的现象。
3046

被折叠的 条评论
为什么被折叠?



