Adnan
Adnan

Reputation: 4607

Selection of datatype for storing images

I want to store and retrieve images to/from database using java beans, which data type should be used for this purpose?

Upvotes: 0

Views: 196

Answers (2)

Justin Cave
Justin Cave

Reputation: 231671

The most conventional approach would be to store the data in a BLOB. That would allow you to read and write the byte stream from Java but wouldn't allow you to do any transformation inside the database.

The other alternative would be to use the interMedia ORDImage type. This provides a great deal more flexibility by allowing the database to do things like generate and return a thumbnail image, to adjust compression quality, etc.

As Grant indicates, LONG RAW (and the character-based LONG) data types have been deprecated so you should not be using them.

Upvotes: 2

Grant Lammi
Grant Lammi

Reputation: 1404

I think BLOB is what you are looking for. RAW types are for legacy support so unless you absolutely have to deal with them I wouldn't.

Upvotes: 2

Related Questions