Problems with insert data into a CLOB column in Oracle
I want to insert data (which is kept in a Reader variable) into a CLOB column in Oracle 9i database but it does not work. When I for example try with the code written below a row is created in the table and the column ID (just a NUMBER column) gets its value but the CLOB column remains empty (and I know there is a value in the Reader variable). Which is the best way to solve this (answers both in Danish and English is OK)??public void executeInsertClob(Reader inReader)
{
try {
CallableStatement cs = null;
con.setAutoCommit(false);
// Call Stored DB procedure for updating clob column
cs = (CallableStatement)
con.prepareCall( "begin INSERT INTO TEST (XML,ID) VALUES (?,?); end;" );
// use setCharacterStream to set the clob parameter.
cs.setCharacterStream(1,inReader,6000);
int id=99;
cs.setInt(2,id );
cs.execute();
con.setAutoCommit(true);
}catch(SQLException sqlEx)
{
sqlEx.printStackTrace();
log = new Log();
log.setLogMessage(sqlEx.getMessage());
log.writeLogFile();
}
}