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;
    }

Comments

Popular posts from this blog

Another user has changed the row with primary key oracle.jbo.Key[12 ].

Working With File Throgh WebUtill

weblogic windows JPS-01050: Opening of wallet based credential store failed. Reason java.io.IOException: Failed to lock cwallet.sso.lck