This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to display image in JTable which is stored in database.

 
Govinda Reddy
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Image is stored in the database as a image datatype,

Example: Photo is the attribute(image datatye) in Employees table from Nothwind database(SQL server 2000).

I want display this image in JTable from this database. In database image stored as binary format. How to convert binary format to image and how to show the image in particular cell in the table which is bounded to the image data type attribute.

Please help me how to solve this issue.
 
Nick Meverden
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Start with:

http://java.sun.com/docs/books/tutorial/jdbc/basics/index.html

http://java.sun.com/j2se/1.5.0/docs/api/java/sql/ResultSet.html

The default cell renderer for JTable is JLabel which displays Numbers, Icons, and Objects. If you wan't to change this you'll need to use DefaultTableCellRenderer
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic