Java 2010/12/09 12:36
Writer writer = ((CLOB)clob).getCharacterOutputStream();
Reader src = new CharArrayReader(contentData.toCharArray());
char[] buffer = new char[1024];
int read = 0;
while ( (read = src.read(buffer,0,1024)) != -1)
{
writer.write(buffer, 0, read); // write clob.
}
src.close();
writer.close();
/**********************************************
* weblogic
* ********************************************/
Clob clob = rs.getClob(1);
Writer writer = ((OracleClob)clob).getCharacterOutputStream();
Reader src = new CharArrayReader(contentData.toCharArray());
char[] buffer = new char[1024];
int read = 0;
while ( (read = src.read(buffer,0,1024)) != -1)
{
writer.write(buffer, 0, read); // write clob.
}
src.close();
writer.close();
/**********************************************
* sunone
* ********************************************/
Clob clob = rs.getClob(1);
Writer characterStream = clob.setCharacterStream(0);
characterStream.write(contentData);
characterStream.close();
/**********************************************
* interstage
* ********************************************/
CLOB clob = ((OracleResultSet)((DelegatingResultSet)rs).getDelegate()).getCLOB(1);
BufferedWriter writer = new BufferedWriter(clob.getCharacterOutputStream());
writer.write(form.getContent());
writer.close();
/**********************************************
*Jeus
* ********************************************/
String upSql = " SELECT CONTENTS FROM CURRICULUM " +
" WHERE SITE_ID = ? AND CURRICULUM_ID = ? AND CURRICULUM_SEQ = ? FOR UPDATE ";
ps = con.prepareStatement(upSql);
ps.setString(1, sSite_id);
ps.setInt(2, Integer.parseInt(sCurriculum_id));
ps.setInt(3, Integer.parseInt(sCurriculum_seq));
rs = ps.executeQuery();
java.sql.Clob clob = rs.getClob("CONTENTS");
Writer writer = ((CLOB)clob).getCharacterOutputStream();
Reader src = new CharArrayReader(sContents.toCharArray());
char[] buffer = new char[1024];
int read = 0;
while ( (read = src.read(buffer, 0, 1024)) != -1){
writer.write(buffer, 0, read);
}
src.close();
writer.close();
http://kjo1023.tistory.com/entry/WAS-별-clob-설정