Posts

Showing posts from 2019

CallableStatement

    public Long getEmployeeIdForAttendance(String attendName) {         Long empId = null;         String callabelStm = "begin ?:=HRS_EMP_PKG.GET_EMPID_4ATTEND(?); end;";         CallableStatement cstm = getDBTransaction().createCallableStatement(callabelStm, 1);         try {             cstm.registerOutParameter(1, Types.NUMERIC);             cstm.setObject(2, attendName.trim());             cstm.executeUpdate();             empId = cstm.getLong(1);         } catch (SQLException e) {             e.printStackTrace();         } finally {             if (cstm != null) {                 try {                     cstm.close();                 } catch (SQLException e) {                     e.printStackTrace();                 }             }         }         return empId;     }

How to execute navigation in RegionNavigationEvent of af:region

    public void onDynamicReqionnavigation(RegionNavigationEvent regionNavigationEvent) {         System.out.println("*******onDynamicReqionnavigation**********");         try{         if (regionNavigationEvent.getNewViewId() == null) {                 navigate("back");         }         }catch(Exception ex){             ex.printStackTrace();             JSFUtils.reportException(ex);         }     }     public void navigate(String controlFlowCase){            NavigationHandler nvHndlr  =            FacesContext.getCurrentInstance().getApplication().getNavigationHandler();            nvHndlr .handleNavigation(FacesContext.getCurrentInstance(), null,            controlFlowCase);        }