//插入
Connection con = null;
PreparedStatement ps = null;
con = ConnectionManager.getConnection();//weblogic线程池对象,不能强制转换为OracleConnection
con.setAutoCommit(true);
ps = con.prepareStatement(sql);
CLOB clob = CLOB.createTemporary((OracleConnection)ps.getConnection(),true,1);
clob.putString(1, content);
ps.setClob(1, clob);
ps.executeUpdate();
//读取
StringBuffer data = new StringBuffer();
String str = "";
CLOB clob = (CLOB)rs.getObject("content");
BufferedReader br = new BufferedReader(clob.getCharacterStream());
while((str=br.readLine())!=null){
data.append(str);
}
String result = new String(data.toString());
br.close();
Connection con = null;
PreparedStatement ps = null;
con = ConnectionManager.getConnection();//weblogic线程池对象,不能强制转换为OracleConnection
con.setAutoCommit(true);
ps = con.prepareStatement(sql);
CLOB clob = CLOB.createTemporary((OracleConnection)ps.getConnection(),true,1);
clob.putString(1, content);
ps.setClob(1, clob);
ps.executeUpdate();
//读取
StringBuffer data = new StringBuffer();
String str = "";
CLOB clob = (CLOB)rs.getObject("content");
BufferedReader br = new BufferedReader(clob.getCharacterStream());
while((str=br.readLine())!=null){
data.append(str);
}
String result = new String(data.toString());
br.close();