aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JTable binding using JPA Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable binding using JPA" Watch "JTable binding using JPA" New topic
Author

JTable binding using JPA

chandu gopi
Greenhorn

Joined: Dec 23, 2009
Posts: 4
Hi,

I'm having a database table containing blob column that contains image for each row. Also I'm having a JTable in front end to display existing records of database.

My requirement is as follows

1) code snippet to bind & persist the image into database column using JPA.
2) retrieving the saved image on a JLabel when ever I select a row in front end JTable using JPA.

I hope you understood my intend.

looking forward for your response.

Regards,
Chandu
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19672
    
  18

What have you done so far?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
chandu gopi
Greenhorn

Joined: Dec 23, 2009
Posts: 4
Hi Rob,

I did jtable binding for inserting data into database by implementing binding between jtable through POJO classes and now I'm in need of storing an image into database using jtable along with other columns data. so, my requirement is how to bind the JLabel that can hold inputted image to store in database along with other column data any derive me the way to display image on JLabel when a row is selected.

I hope this explanation is sufficient to help me get of the problem.

Regards,
Chandu
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19672
    
  18

The JTable can have selection listeners added; listen to those. Their events tell you which row(s) are selected.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTable binding using JPA