File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes JavaDB maximum BLOB size Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "JavaDB maximum BLOB size" Watch "JavaDB maximum BLOB size" New topic

JavaDB maximum BLOB size

Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970

I have an application that stores binary data in BLOBs in a JavaDB (aka Derby) database. The data is usually quite small (e.g. 10 kilobytes) but just occasionally rather larger (we've seen 500 kilobytes).

When I first wrote the application, I somewhat arbitrarily specified 256 kilobytes as the maximum BLOB size. The 500k data therefore overflowed this.

I could just raise the limit a bit. However, I have some questions.

Is there any benefit to minimising the specified BLOB size?

If no limit is specified, you get the JavaDB limit, which is 2GB, I think. Does it save disk space or improve performance to limit the size?

Is there any reason why I shouldn't just remove the limit altogether and let it go up to the JavaDB limit (which it won't even get close to hitting - I hope!).

Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33102

As far as I know, the database stores a pointer to the BLOB in the part of the table with the other columns. So I don't think there would be ramifications to changing the BLOB size. In fact some databases don't even allow you too set the maximize size. The true maximum is set by the database and if you use less it is fine. They don't introduce an artificial limit.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: JavaDB maximum BLOB size
It's not a secret anymore!