aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes How to display image in JTable which is stored in database. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to display image in JTable which is stored in database." Watch "How to display image in JTable which is stored in database." New topic
Author

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

Govinda Reddy
Greenhorn

Joined: Apr 07, 2006
Posts: 7
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

Joined: Jul 03, 2006
Posts: 59
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
 
jQuery in Action, 2nd edition
 
subject: How to display image in JTable which is stored in database.