بتاريخ: 5 يوليو 20196 سنة comment_298695 السلام عليكم ورحمة الله كيف يمكنني عمل تسلسل الموظفين كترقيم تلقائي من خلال الـ ADF ؟ تم تعديل 5 يوليو 20196 سنة بواسطة Ya Zahra تقديم بلاغ
بتاريخ: 6 يوليو 20196 سنة comment_298696 داخل ال entityEmpl لجدول الموظفيين عمل تسلسل لل id واخر لرقم الموظف protected void doDML(int operation, TransactionEvent e) { if (operation==DML_INSERT) { SequenceImpl seq = new SequenceImpl("EMP_SEQ", getDBTransaction()); Number n = seq.getSequenceNumber(); setEmpId(n); try { String sql = "select MAX(NVL(EMP_NO,0)) from EMPLOYEE "; PreparedStatement stat = getDBTransaction().createPreparedStatement(sql, 1); ResultSet rs = stat.executeQuery(); System.out.println("rs = "+rs); if (rs.next()) { int max = rs.getInt(1) + 1; setEmpNo(max); } else { int max = 1; setEmpNo(max); } } catch (SQLException sqle) { // TODO: Add catch code System.out.println("sql = "+sqle); sqle.printStackTrace(); } } super.doDML(operation, e); } تقديم بلاغ
بتاريخ: 9 يوليو 20196 سنة كاتب الموضوع comment_298718 سلمت الايادي استاذ rabie وجزاك الله عنا خيرا. تقديم بلاغ
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.