EJB2009. 1. 16. 21:44
    con = ds.getConnection();
    ps = con.prepareStatement("update board set name=?, title=?, content=empty_clob() where seq=?");
    ps.setString(1, boardData.getName());
    ps.setString(2, boardData.getTitle());
    ps.setInt(3, boardData.getSeq());
    ps.executeUpdate();
    ps.close();
 
    ps = con.prepareStatement("select content from board where seq=? for update");
    ps.setInt(1, boardData.getSeq());
    rs = ps.executeQuery();
    rs.next();
 
    java.sql.Clob clob_content = rs.getClob(1);
    Writer writer1 = ((weblogic.jdbc.common.OracleClob)clob_content).getCharacterOutputStream();
    StringReader sr = new StringReader(boardData.getContent());
    char[] buffer1 = new char[512];
    int readCount = 0;
    while((readCount = sr.read(buffer1)) != -1){
     writer1.write(buffer1, 0, readCount); 
    }
    sr.close();
    writer1.close();
Posted by 아마데우스