aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes 4081 bytes too big for weblogic and oracle? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "4081 bytes too big for weblogic and oracle?" Watch "4081 bytes too big for weblogic and oracle?" New topic
Author

4081 bytes too big for weblogic and oracle?

paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20582
    ∞

I finally get my very first bean working.
But there is one weird problem. I'm trying to stuff an HTML fragment into an oracle table where the field type "LONG". "LONG" is supposed to hold character data up to two gigs. I'm passing in strings in the 2 to 3 k range. When I try to pass a string over 4000 bytes I get this message:
java.sql.SQLException: Data size bigger than max size for this type: 4081
4081 is the exact size of the string I am trying to put into this field.
This exception message is wrapped up from the server and sent to my client. I see it on the weblogic window too. So the CMP is freaking out about the size of my string.
Is this something that I configure somewhere? Like "maxSizeOfString=20k"?


permaculture Wood Burning Stoves 2.0 - 4-DVD set
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20582
    ∞

I figured it out!
Apparently the JDBC driver is lame. If I pass the big data through a stream, all is well.
Jim Thomas
Greenhorn

Joined: Apr 23, 1999
Posts: 5
Make sure you have the latest JDBC drivers from Oracle. You can download them for free. Have you considered using a CLOB datatype instead?
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20582
    ∞

Apparetnly the field was once CLOB and somebody decided to go with LONG instead.
Apparently the JDBC drivers we are using now are a month old. What are the most recent?
mohit joshi
Ranch Hand

Joined: Sep 23, 2000
Posts: 243
just documenting another reason for this error to appear, even while using IOStreams. This happens if you have upgraded from JDK1.1 to JDK1.2 and forgot to upgrade the Oracle thin driver : ( classes111.zip to classes12.zip ).
Jing C
Greenhorn

Joined: Mar 07, 2003
Posts: 1
Hi Paul,
Please advise how to pass the big data to the oracle db through a stream. I am encountering the exact same problem as you.
Thanks a lot!
Jing
Originally posted by Paul Wheaton:
I figured it out!
Apparently the JDBC driver is lame. If I pass the big data through a stream, all is well.
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20582
    ∞

I'm stealing some code from the com.javaranch.common stuff. I hope that this isn't too much:

The important part is "new StringBufferInputStream()" which is deprecated, but it was the only thing I found that would work.
There could be better solutions available now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: 4081 bytes too big for weblogic and oracle?