|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
commitchange function not work properlyHi All, I have some difficulties when I am doing update operation on database table.
DB table looks like ID Component1 Component1_Desc Component2 Component2_Desc Component3 Component3_Desc 1 _ NULL NULL NULL 2 NULL NULL NULL Value of column 'Component1', 'Component2', 'Component3' for second record is ' ' (Space). In my table layout setting, I selected Component1, Component2, Component3. (Component Type: Text Field ) I believe that I setup virture form properly because I can save updates on first record. However, any changes I made on second records disappear after I call commitchange() I suspect there is sth to do with the ' ' in column1, column2 and column3. There is no error message displayed. Please help me. Thanks in advance. ----------------------------------------------------------------------------- public String btnSave_action() { try{ prb_myprb_trackingDataProvider.commitChanges(); prb_myprb_trackingDataProvider.refresh(); }catch(Exception ex){ log("Error Description", ex); error(ex.getMessage()); } return null; } |
|
|
|
|
|
Re: commitchange function not work properlyHi David,
This is very helpful. Thanks a lot! By checking the SQL, I found where is the problem come from. Basically, I didn't select column 'ID' in CachedRowSet. That's why NetBean give me following SQL statement. INSERT INTO PRB_myPRB_detl4 (Component_Column1, Component_Column2, Component_Column3) VALUES (?, ?, ?) SELECT Component_Column1, Component_Column2, Component_Column3 FROM PRB_myPRB_detl4 WHERE Component_Column1 = ? AND Component_Column2 = ? AND Component_Column3 = ? Paramm[1]=(java.lang.String,_) Paramm[2]=(java.lang.String,_) Paramm[3]=(java.lang.String,_) Writer: executing pre-update SELECT Writer: pre-update SELECT returned >1 row: BAD After adding ID in CachedRowSet, it works fine now. Thanks again for the help! Frank
|
| Free embeddable forum powered by Nabble | Forum Help |