Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Retrieving image from database - getBlob?

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anybody any advice?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic