求助:从ORACLE取CLOB类型数据!!!!!

03-12-15 afang

从ORACLE数据库中取CLOB类型数据,数据可以取出,但只能显示第一段:代码如下:

String sql="select * from ltinfo where ID = '" + ID + "' and LANGUAGE = 'gb' and INFO_STATE = 'issue_state'";

Statement stmt = conn.createStatement();

ResultSet rs = stmt.executeQuery(sql);

if(rs.next()){

INFO_TYPE = rs.getString("INFO_TYPE");;

TITLE = rs.getString("TITLE");

SOURCE = rs.getString("SOURCE");

CREATETIME = rs.getString("CREATETIME");

ATTACHMENT = rs.getString("ATTACHMENT");

oracle.sql.CLOB clob = (oracle.sql.CLOB)rs.getClob("BODYDESCRIBE");

BufferedReader in = new BufferedReader(clob.getCharacterStream());

BODYDESCRIBE = in.readLine();

}

husthxd
2003-12-16 12:31

用buffer读取