Hiya!

My Entity beans (BMP) have to write XML data into a CLOB field in an oracle
database, but when I try to set it to a load of XML which is longer than
4000 characters, I get the following exception:

javax.ejb.EJBException: Error executing SQL INSERT INTO CONTENT (DOCUMENTID,
STARTDATE, ENDDATE, DEPARTMENT, TYPE, XML, SUBTYPE) VALUES ( ?, ?, ?, ?, ?,
?): java.sql.SQLException: ORA-01461: can bind a LONG value only for insert
into a LONG column

I am using classes12.zip for my drivers, and I am using the thin oracle
driver...

Pleeeeease has anyone else hit upon this, and can they help?  This is a
complete showstopper!!  I cannot believe there is a 4000 char limit on CLOBS
in Oracle 8i, else why use them?  I might as well use a varchar2...

I think tonight is the night I painfully remove all my hair ;-)

Tim...

PS:  I write my clobs like this (in the BMP bit of the entity bean)

      statement = connection.prepareStatement("INSERT INTO CONTENT
(DOCUMENTID, STARTDATE, ENDDATE, DEPARTMENT, TYPE, XML, SUBTYPE) VALUES (?,
?, ?, ?, ?, ?, ?)");
      statement.setString(1, documentid);
      statement.setTimestamp(2, startdate);
      statement.setTimestamp(3, enddate);
      statement.setString(4, department);
      statement.setString(5, type);
      statement.setAsciiStream( 6, new ByteArrayInputStream(
xml.getBytes() ), xml.length() ) ;
      statement.setString(7, subtype);
      if (statement.executeUpdate() != 1)
      {
        throw new CreateException("Error adding row");
      }

with xml being a java.lang.String...



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]

Reply via email to