在这种情况下,我将使用 jDev 和使用的应用程序模块将空/空值插入我的数据库。
这是 bean 中的代码:
public void insertM_LLOYDAGENT(ActionEvent actionEvent) {
// Add event code here...
UnderwritingAppModuleImpl am = (UnderwritingAppModuleImpl)ADFUtil.getApplicationModule("UnderwritingAppModuleDataControl");
try{
address = noteAddress.getValue().toString();
city = noteCity.getValue().toString();
contact = noteContact.getValue().toString();
country = noteCountry.getValue().toString();
name = noteName.getValue().toString();
type = typeOfLloyd.getValue().toString();
am.insertMLLOYDAGENT(address, city, contact, country, name, type);
}
catch(Exception ex){
am.insertMLLOYDAGENT(address, city, contact, country, name, type);
}
}
以及 AppModuleImpl 中的代码:
public void insertMLLOYDAGENT(String noteAddress, String noteCity, String noteContact, String noteCountry, String noteName, String noteType){
try {
System.out.println("tes ------- address = "+noteAddress+" city = "+noteCity+" contact = "+noteContact+" country = "+noteCountry+" name = "+noteName+" type = "+noteType);
MLloydagentViewImpl vo=(MLloydagentViewImpl)getMLloydagentView1();
MLloydagentViewRowImpl row=(MLloydagentViewRowImpl)vo.getCurrentRow();
row.setLloydName(noteName);
row.setLloydAddress(noteAddress);
row.setLloydCity(noteCity);
row.setLloydContact(noteContact);
row.setLloydCountry(noteCountry);
row.setTypeOfLloyd(noteType);
row.getDBTransaction().commit();
vo.executeQuery();
} catch (JboException ex) {
throw ex;
}
}
为什么新行没有提交?请帮我。谢谢 !