Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable binding using JPA

 
chandu gopi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20527
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What have you done so far?
 
chandu gopi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20527
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JTable can have selection listeners added; listen to those. Their events tell you which row(s) are selected.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic