Java 操作 Oracle CLOB 字段

'Inserting CLOB Values with setCharacterStream() Method' tutorial was cited in a blog article in Chinese in 2014.

The Inserting CLOB Values with setCharacterStream() Method tutorial was cited in a blog article in Chinese in 2014.

Subject: java 操作 oracle clob 字段
Date: Jun 16, 2014
Author: lyjilu
Source: http://lyjilu.iteye.com/blog/2081392

问题是这样,系统中要对oracle数据库的clob字段进行插入, 使用如下方法:

    StringReader c = new StringReader(s);  
    pstmt.setCharacterStream(i+1, c);  

居然报错!错误如下:

    Cause: java.lang.AbstractMethodError: 
    oracle.jdbc.driver.T4CPreparedStatement.
    setCharacterStream(ILjava/io/Reader;)V  

然后就是各种google、换驱动,最后在 
http://www.herongyang.com/JDBC/Oracle-CLOB-setCharacterStream.html
找到了答案;
 
最后修改为如下代码后,程序正确执行:

    StringReader c = new StringReader(s);  
    pstmt.setCharacterStream(i+1, c,s.length());  

 oracle这重载方法真........ 

Table of Contents

 About This Book

 Reference Citations in 2016

 Reference Citations in 2015

Reference Citations in 2014

 org.apache.commons.io.input.ReversedLinesFileReader

 Node.js and openSSL

 MD5 算法在 Java 语言

 Rpc Encoded requires encodingStyle on body #12

Java 操作 Oracle CLOB 字段

 Conjunto de resultados

 Java Programming (Course Notes)

 How to use nusoap to consume an online webservice?

 Wireless Spontaneous Network Creation ...

 MySQL prepared statement in Java not returning a value

 All chocolatey commands come back as "/c: ..."

 Hack Go – generate non-FIPS DSA key parameters...

 How to take adb logcat, and store it in system?

 Loose Coupling and Substitution Principle ...

 Ruby Driver 1.0 for Apache Cassandra Documentation

 Reference Citations in 2013

 Reference Citations in 2012

 Reference Citations in 2011

 Reference Citations in 2010

 Reference Citations in 2009

 Reference Citations in 2008

 Reference Citations in 2007

 Reference Citations in 2006

 Reference Citations in 2005

 Reference Citations in 2004

 Reference Citations in 2003

 PDF Printing Version