aspose file tools
The moose likes Java in General and the fly likes mysql, blobs, images Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "mysql, blobs, images" Watch "mysql, blobs, images" New topic
Author

mysql, blobs, images

Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1098

i have one program that inserts an image onto a mysql database



and then one that trys to read it and display it


the exception i am getting is:


so how do i tell if it is the insert or select that is failing?
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24081
    
  15

What is "ALLBITS"?

bytes = blob.getBytes(1, ALLBITS);

Shouldn't this be

bytes = blob.getBytes(1, blob.length());


[Jess in Action][AskingGoodQuestions]
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1098

i saw allbits, and it made sense so tried it, your version works a lot better.
Thanks.
but is there a way to get the blob out just using mysql as i am sure i will have further problems?
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24081
    
  15

Hi Wendy,

Hmm, what do you mean exactly, "Just using mysql?" I don't understand.
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1098

sorry nothing really, now i have the test read program working that is fine, thank you very much
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: mysql, blobs, images
 
Similar Threads
Rotating an image
Please help me complete steps to upload an image
Display of images in JSP
copy paste java object using System clipboard
Play video file frame by frame