Two Laptop Bag*
The moose likes JDBC and the fly likes storing BLOB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "storing BLOB" Watch "storing BLOB" New topic
Author

storing BLOB

muthu muruges
Ranch Hand

Joined: Feb 28, 2003
Posts: 70
Hi,
I am having binary(digest using SHA1) value in byte array. I want to store it in to database. The database column type is BLOB(Mysql). I thought of using setBlob method of PreparedStatement, but the Blob is an interface So I coulnd't create the instance for that.

How to create Blob instance in java, any standard implementation is available?

Please let me know if any other option is there other than Blob columns to store binary values.

Thanks in advance,
Muruges
ch praveen
Ranch Hand

Joined: Mar 08, 2004
Posts: 67
Hello muthu muruges,

For storing binary values, you may use getBytes() or setBytes() methods. Wish you best of luck.

Regards,
Ch.Praveen Kumar.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: storing BLOB
 
Similar Threads
Problems with file upload
How to retreive a blob....
HTML as BLOB
How to convert an object into BLOB
Image Databases