`

can bind a LONG value only for insert into a LONG

阅读更多

    今天在开发时发现一个问题:定义了一个oracle 的clob字段类型,当给这个表做insert操作时,如果给clob字段的值超过一定大小时,会报
ORA-01461: can bind a LONG value only for insert into a LONG column
的错误。
    
     在网上查了一下,有一种做法是做insert的时候先给clob字段赋一个空值,然后再做update操作。但是这种做法我没有成功。还有另外一种做法是使用oracle10的驱动,不用oracle9i 的驱动,据说是能够解决问题。这个方法我没有试。我试的是另外一种办法。因为这个项目用的应用服务器是weblogic,而且也不会换成tomcat之类的轻量级应用服务器,所以我用的是weblogic的oracle驱动*BEA's Oracle  Driver (Type 4)  Versions:8.1.7,9.0.1,9.2.0。也能够解决该问题。

     我一时觉得weblogic真的是一个很牛的公司啊(虽然它已经被oracle收购了),自己的jdk比sun的jdk要快,自己的oracle驱动也要比oracle的驱动好。

分享到:
评论

相关推荐

    Google C++ Style Guide(Google C++编程规范)高清PDF

    More complex inline functions may also be put in a .h file for the convenience of the implementer and callers, though if this makes the .h file too unwieldy you can instead put that code in a ...

    2009 达内Unix学习笔记

    [] 匹配中括号里的内容[a-z][A-Z][0-9]。 ! 事件。 $ 取环境变量的值。 | 管道。把前一命令的输出作为后一命令的输入,把几个命令连接起来。 |经常跟tee连用,tee 把内容保存到文档并显示出来。 三、通用后...

    MYSQL C API预处理语句

    bind[0].buffer = &value; bind[0].buffer_length = sizeof(long); bind[0].is_null = 0; bind[0].length = 0; // 绑定参数到预处理语句 if (mysql_stmt_bind_param(stmt, bind)) { handle_error(stmt); } // ...

    Excel 导入 数据 spring boot

    @Query(value = "INSERT INTO user(name, age) VALUES(:name, :age)", nativeQuery = true) void saveAllFromExcel(@Param("name") String name, @Param("age") int age); } ``` 在导入数据时,你可以根据实际...

    Cassandra1.0.x实用教程

    - `PreparedStatement ps = session.prepare("INSERT INTO Products (Id_Product, Product_Name, ...) VALUES (?, ?, ...);");` - **执行插入操作**: - `session.execute(ps.bind(1L, "ProductName", ...));` ###...

    MybatisPlus中插入数据后获取该对象主键值的实现

    @Insert("INSERT INTO employee(last_name, email, gender, age) VALUES (#{lastName}, #{email}, #{gender}, #{age})") @SelectKey(statement = "SELECT LAST_INSERT_ID()", keyProperty = "id", before = false,...

Global site tag (gtag.js) - Google Analytics