aspose file tools*
The moose likes JDBC and the fly likes Not able to insert image more than 4K in Database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Not able to insert image more than 4K in Database" Watch "Not able to insert image more than 4K in Database" New topic
Author

Not able to insert image more than 4K in Database

Vinu Valayil
Greenhorn

Joined: May 08, 2009
Posts: 5
Hi,

Just a shot in the dark: I hope you don't have multiple versions of these jars sitting on the classpath.
You might as well check the server classpath and see what's in place.
As mentioned by Paul before, the problem can be narrowed to the correct jar being used.

Regards, Vinu


What is this life if full of care,
We have no time to stand and stare
Vinu Valayil
Greenhorn

Joined: May 08, 2009
Posts: 5
Posting this again
Hi,

Just a shot in the dark: There might be multiple versions of the same jar or conflicting jars in the server's classpath.
Could you check that as well?

Regards, Vinu

sk mehrotra
Ranch Hand

Joined: Oct 27, 2005
Posts: 34
Tring to upload files of sizes 6K, 10K and 800K, but result is the same.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

sk mehrotra wrote:Tring to upload files of sizes 6K, 10K and 800K, but result is the same.

I meant what size are they on the web server? Did you succesfully stream the whole file there in the first place?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
sk mehrotra
Ranch Hand

Joined: Oct 27, 2005
Posts: 34
Yes the file stored to the disk is OK.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

So it sounds like it is your classpath that is the issue.
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2516
    
  10

Or you are connecting to a different database in the two tests.
Note that not all Oracle versions supporrted LOBs with more than 4K.

Can you check this? And give your table description in the database used in your web application and your test application?


OCUP UML fundamental and ITIL foundation
youtube channel
sk mehrotra
Ranch Hand

Joined: Oct 27, 2005
Posts: 34
Table Script Used :
CREATE TABLE UPLOAD_TEST
(
ID VARCHAR2(100),
IMAGE BLOB
)
TABLESPACE TESTTBL
LOGGING
LOB (IMAGE) STORE AS
( TABLESPACE TESTTBL
ENABLE STORAGE IN ROW
CHUNK 8192
PCTVERSION 10
NOCACHE

)
NOCACHE
NOPARALLEL

And I am only connecting to the One Database.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Back to looking at the classpath then.
Moojid Hamid
Ranch Hand

Joined: Mar 07, 2009
Posts: 120
ENABLE STORAGE IN ROW

I am no Oracle expert, but as far as I know the max LOB size in row is 4K. could this line be causing the problem?

Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

That doesn't truncate the entered value it just denotes that up to 4k of the LOB should be stored inline. The rest is punted of to another location. According to sk mehrotra they have successfully managed to insert >4k via JDBC in a stand alone application so the DDL should not be affecting this.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Not able to insert image more than 4K in Database