我在Oracle数据库中创建了下表(jdbctesttable):其中text的类型为clob。
id    name   birthday     text
1     jac    2007-09-08   null
2     sam    2007-03-23   null我现在想通过update使得id为1的一行记录中的text(clob)加入一个新的Clob的大字段(字段来自于一个文件)如下是我的代码public void updateClob(String fileName) {
try {
conn = getConn();
                           String sql = "update jdbctesttable set text = ? where id = 1";
ps = conn.prepareStatement(sql);
File file = new File(fileName);
Reader reader = new BufferedReader(new FileReader(file));
ps.setClob(1, reader, (int)file.length());
int i = ps.executeUpdate();
reader.close();
if(i > 0)
System.out.println("更新CLOB数据成功!");
else
System.out.println("更新CLOB数据失败!");
} catch (SQLException e) {
e.printStackTrace();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}finally {
GetConnectionAndFreeAll.getGetConnectionAndFreeAll().freeAll(rs, ps, conn);
}
}就是其中红色的部分报错,请问一下还有没有其他的什么办法可以实现我要的这个功能呢,小弟跪谢了!