Ms Access 2007 update Delay When try to re-query immediately after update in Java application
===

 I trying to update my table before I want to display it in Jtable. However,after the SQL update done and I try to query the database and display the data in Jtable, the data is not updated. Is there any solution to solve this problem? Here is my Java Code. 

    public class ReserveForm extends javax.swing.JFrame {

    private Vector<Vector<String>> newData;
    private Vector<Vector<String>> data;
    private Vector<String> header;
    String query = "SELECT R.Patron_ID, Name, R.Book_ID, Title, Reserve_date, Expired_date, Status FROM tblReserve R, tblPatron P, tblBook B WHERE R.Patron_ID = P.Patron_ID AND B.Book_ID = R.Book_ID";

    /**
     * Creates new form ReserveForm
     */
    public ReserveForm() throws Exception {
        /**
         * Creates new form PatronForm
         */
        DatabaseAccess dbAccess = new DatabaseAccess();
        data = dbAccess.queryTable(query);
        Vector<String> temp;
        String status;

        for (int a = 0; a < data.size(); a++) {
            temp = data.get(a);

            Calendar calendar = Calendar.getInstance();
            SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
            Date expiredDate = new Date();
            Date currentDate = new Date();
            long dayAfterDue;
            try {
                status = temp.get(6).toString();
                expiredDate = dateFormat.parse(temp.get(5).toString());
                currentDate = calendar.getTime();
                System.out.println(expiredDate.toString());
                dayAfterDue = (currentDate.getTime() - expiredDate.getTime()) / (24 * 60 * 60 * 1000);
                System.out.println(dayAfterDue);
                System.out.println(status);

                if (dayAfterDue > 0 && !status.equalsIgnoreCase("Expired") && !status.equalsIgnoreCase("Check Out")) {
                    String query2 = "UPDATE tblReserve SET Status = 'Expired' WHERE Patron_ID = '" + temp.get(0).toString() + "' AND Book_ID = '" + temp.get(2).toString() + "'";
                    System.out.println(query2);

                    dbAccess.updateTable(query2);
                }

            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        
        data.clear();
        this.initiateComponent();
    }
        
        public void initiateComponent() throws Exception{
        DatabaseAccess dbAccess = new DatabaseAccess();
        header = new Vector<String>();
        header.add("Patron_ID");
        header.add("Name");
        header.add("Book_ID");
        header.add("Title");
        header.add("Reserve_Date");
        header.add("Expired_Date");
        header.add("Status");
        data = dbAccess.queryTable(query);
        
        


        initComponents();
        jTable1.getColumnModel().getColumn(0).setPreferredWidth(60);
        jTable1.getColumnModel().getColumn(1).setPreferredWidth(100);
        jTable1.getColumnModel().getColumn(2).setPreferredWidth(60);
        jTable1.getColumnModel().getColumn(3).setPreferredWidth(200);
        jTable1.getColumnModel().getColumn(4).setPreferredWidth(60);
        jTable1.getColumnModel().getColumn(5).setPreferredWidth(60);
        jTable1.getColumnModel().getColumn(5).setPreferredWidth(50);

        this.setLocationRelativeTo(getRootPane());
      
    }
