Code for inserting record in Database programmatically.
public String cb2_action() {
// Add event code here...
Row newRow;
BindingContainer bindings = getBindings();
OperationBinding operationBinding = bindings.getOperationBinding("Commit");
Object result ;
ApplicationModule am = ADFUtils.getApplicationModuleForDataControl("BHCModuleDataControl"); //application name from data controls and not application module
ViewObject myView = am.findViewObject("TempView1"); //view name from data controls
newRow = (oracle.jbo.server.ViewRowImpl)myView.createRow();
newRow.setAttribute("Name", "Amol");
myView.insertRow(newRow);
operationBinding = bindings.getOperationBinding("Commit");
result = operationBinding.execute();
return null;
}
Note: Drag and Drop Commit operation from Datacontrol on jsf page to get Commit binding in page definition.