• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Retrieving image from database - getBlob?

 
Stefan Renemeister
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I am performing my first steps in java JDBC, and as an exercise try to show some images from a mysql database.
The thing below runs, but doesn't show my photo's. (it does show the id's however).
It returns the following error:

SQLException: Column Index out of range, 0 < 1.
SQLState: S1009
VendorError: 0


What am I doing wrong? And more important, what is the proper way to show my photo? Any help is greatly appreciated!

 
Stefan Renemeister
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Duuuh, forgot the quotes in the columnname..

Should have been:

instead of:


Ok, well here's the following question:

my result of above code is:

1
com.mysql.jdbc.Blob@84da23
2
com.mysql.jdbc.Blob@d3d6f


I'd like to see the actual pics, instead of the data.. How can I transform this into a picture?
 
Stefan Renemeister
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anybody any advice?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic