Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> inserting into CLOB (jdbc)
I've scoured the documentation and have tried a number of things but it is unclear to me how I should insert into CLOB columns using JDBC (on 8i using Oracle 8.1.5 drivers).
For example (using bits and pieces of relevant code:):
mytable (myclob clob)
Stream into the column on insert?
ByteArrayInputStream bais = new ByteArrayInputStream(myString.getBytes()); pstmt.setAsciiStream(1,bais,myString.length()); -This seems to be for LONGVARCHAR and returns an error ("ORA-01461")
Insert a blank record, select from it in order to get the CLOB locator, then update the record using a CLOB ? (This seems somewhat strange but nonetheless...):
// after the select CLOB myclob = ((OracleResultSet)rset).getCLOB (1); myclob.putString(1,myString); -This gives a "Data size bigger than max size for this type.." error.
Any hints?
--
dcha_at_best.com
Received on Thu Jun 03 1999 - 21:48:32 CDT