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 get a file into an blob Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "get a file into an blob" Watch "get a file into an blob" New topic

get a file into an blob

holger Hahn

Joined: Jun 14, 2005
Posts: 9
Please help me,

I don't know ho to get a tiff-file into an Blob to write it in an DataBase with entity Beans. Can someone give an code example?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63870

Please read this topic.

[Asking smart questions] [About Bear] [Books by Bear]
holger Hahn

Joined: Jun 14, 2005
Posts: 9
Oh Sorry
I will specify what I mean

i have an getter and setter method in my Entity Bean. The parameter of the getter and setter is an byte array. (public abstract byte [] getPicData (); and public abstract void setPicData(byte [] picData);
I use Jboss application Server V4.0 and MySQL V.4
When I read a file in png-Format from the client and write it with the help of my Entity Bean in the database (use CMP). The problem is that the file is 200kb befor i write it in the database and 63kb (65565bytes) when i get it from the database. I don't know why

Please help me
I agree. Here's the link:
subject: get a file into an blob
It's not a secret anymore!