Large data entry issue

F

francan00

My Form entry uses a Clob data type. The insert always works using
Java PreparedStatement if the form entry is under 4000 characters.
The database is Oracle 9i using ojdbc14 driver on my Tomcat web
container.
Due to restrictions I cant update the ojdbc14 driver at this time.

The issue is when the Form entry is over 4000 characters it wont enter
any data into the database. The error message I get -> SQL Exception:
Data size bigger than max size for the type: 12463

Please advise how I can make it work?
 
A

Arne Vajhøj

My Form entry uses a Clob data type. The insert always works using
Java PreparedStatement if the form entry is under 4000 characters.
The database is Oracle 9i using ojdbc14 driver on my Tomcat web
container.
Due to restrictions I cant update the ojdbc14 driver at this time.

The issue is when the Form entry is over 4000 characters it wont enter
any data into the database. The error message I get -> SQL Exception:
Data size bigger than max size for the type: 12463

I have once used this technique:

stmt.executeUpdate("INSERT INTO lobbo VALUES(1,EMPTY_CLOB())");
ResultSet upd = stmt.executeQuery("SELECT txt FROM lobbo WHERE id=1 FOR
UPDATE");
upd.next();
PrintWriter pw = new
PrintWriter(((oracle.sql.CLOB)upd.getClob(1)).getCharacterOutputStream());
pw.println("yada yada");
pw.close();
con.commit();

Arne
 
F

francan00

I have once used this technique:

stmt.executeUpdate("INSERT INTO lobbo VALUES(1,EMPTY_CLOB())");
ResultSet upd = stmt.executeQuery("SELECT txt FROM lobbo WHERE id=1 FOR
UPDATE");
upd.next();
PrintWriter pw = new
PrintWriter(((oracle.sql.CLOB)upd.getClob(1)).getCharacterOutputStream());
pw.println("yada yada");
pw.close();
con.commit();

Arne

Thanks I will try it tomorrow. Is oracle.sql.Clob class in Java 1.4
because that is the version I am using.
 
A

Arne Vajhøj

Thanks I will try it tomorrow. Is oracle.sql.Clob class in Java 1.4
because that is the version I am using.

It is not in any Java version.

But it is in the Pracle JDBC driver for Java 1.4 (ojdbc14.jar).

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top