aspose file tools*
The moose likes Beginning Java and the fly likes Update DB using Jlist gives Primary Key Duplication error. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Update DB using Jlist gives Primary Key Duplication error." Watch "Update DB using Jlist gives Primary Key Duplication error." New topic
Author

Update DB using Jlist gives Primary Key Duplication error.

rayan alex
Ranch Hand

Joined: Nov 25, 2012
Posts: 33
    
    1
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


 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Update DB using Jlist gives Primary Key Duplication error.