File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Govinda Reddy
Greenhorn
Posts: 7
  • 0
  • 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
  • 0
  • 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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic