Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Update DB using Jlist gives Primary Key Duplication error.  RSS feed

Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my program i have item management window. It has Jlist component to add Multiple bag sizes. Since its a multi value attribute, i placed in a separate table with item code.
I managed to write the program to update database thru text fields except Jlist.
There is Primary key Duplicate error at Jlist update code.
When i try to update item adding or removing bagsizes to Jlist it gives Primary key duplication error.
This is sample format how date stored in bagsizes tables.

item1 30
item1 40
item1 50

item2 30
item2 50

item3 40
item3 30

Code for Update Action and method at the controller class given below.

Code for Update Action

Code for database update

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!