Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> inserting into CLOB (jdbc)

inserting into CLOB (jdbc)

From: Doug Cha <dcha_at_shell2.ba.best.com>
Date: 04 Jun 1999 02:48:32 GMT
Message-ID: <37573e80$0$222@nntp1.ba.best.com>

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US