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 -> Re: Using jdbc to write data to Clob column

Re: Using jdbc to write data to Clob column

From: J. Harris <harris.john.a_at_worldnet.att.net>
Date: Fri, 21 Jun 2002 05:24:12 GMT
Message-ID: <0MyQ8.47088$LC3.3593598@bgtnsc04-news.ops.worldnet.att.net>


Cindy,

Thanks, I've checked this out. My problem is that I'm trying to develop this without importing oracle.*, to make it as generic as possible. I guess some questions I need to have answered are:

The code I'm trying to update will only have access to a PreparedStatement object, does this mean on an insert I would have to do an "insert into tableA (clob_field) values ('empty_clob()')", then acquire a ResultSet and rs.getClob()? So I can't use the setCharacterStream() of the PreparedStatement object when trying to insert a row?

-John

"C. Ferguson" <c_ferguson_at_rationalconcepts.com> wrote in message news:3D12B275.2F45ABE5_at_rationalconcepts.com...
> Hi,
> have a look at
>

http://technet.oracle.com/sample_code/tech/java/sqlj_jdbc/files/advanced/LOB Sample/LOBSample.java.html
>
> If you don't have a technet account, sign up for one. They are free.
Then
> browse the site.
>
> hth,
> Cindy
>
> "J. Harris" wrote:
>
> > I'm trying to get the following code to work, however when I do run the
code
> > below I get an Io exception: Connect reset by peer: socket write
error...
> >
> > if (column.isClob())
> > {
> > String str = column.getValue();
> > int strlength = str.length();
> > Reader reader = new StringReader(str);
> > stmt.setCharacterStream(ps++, reader, rlength);
> > }
> >
> > int ret = stmt.executeUpdate();
> >
> > Any ideas?
>
Received on Fri Jun 21 2002 - 00:24:12 CDT

Original text of this message

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