wood burning stoves 2.0*
The moose likes JDBC 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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "get a file into an blob" Watch "get a file into an blob" New topic
Author

get a file into an blob

holger Hahn
Greenhorn

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?
Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60739
    
  65

Please read this topic.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
holger Hahn
Greenhorn

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: http://aspose.com/file-tools
 
subject: get a file into an blob
 
Similar Threads
How to upload a byte array into BLOB column?
to get Database blob to JPG file
How to see the content of BLOB Field
Inserting BLOB's in database
need to read the blob and convert it into a file