This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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
Boost this thread!