oracle.sql.CLOB clob = (oracle.sql.CLOB)rs.getClob(1);
        clob.putString(1, this.content);      oracle.sql.CLOB clobtmp = (oracle.sql.CLOB) ors.getClob("content");
        readerClob=clobtmp.getCharacterStream();
        其中putString和getCharacterStream是ORACLE9I中的用法 
        现在到了ORACLE10G  是已经不推荐使用的方法了 
        我现在的数据库为10G 想用10G的API替换掉这些原来的方法
        请参照http://www.oracle.com/technology/sample_code/tech/java/codesnippet/jdbc/clob10g/handlingclobsinoraclejdbc10g.html
        是否可以将这两个方法替换成getString(1);和setString(1, str);

解决方案 »

  1.   

    orace官方网站啊 。全英文的哈哈,不过有例子艾。不过我不懂java要不帮你看了哈哈
      

  2.   

    import java.sql.*;
    import java.io.*;
    import java.util.*;
    import oracle.jdbc.*;
    import oracle.jdbc.pool.*;
    ..........// Create SQL query to insert CLOB data and other columns in the database.
    String sql = "INSERT INTO clob_tab VALUES(?)";      
    // Read a big file(larger than 32765 bytes). 
    // Note: method readFile() not listed here. 
    // It can be any method that reads a file.String 
    str = this.readFile("bigFile.txt");
    // Create the OraclePreparedStatement objectopstmt = (OraclePreparedStatement)conn.prepareStatement(sql);
    // Use the new method to insert the CLOB data (for data greater or lesser than 32 KB)
    opstmt.setStringForClob(1,str);// Execute the OraclePreparedStatementopstmt.executeUpdate();...........OraclePreparedStatement.setStringForClob()
    能不能处理小于32765的字节吗?