import java.text.*;
import java.util.*;

public class ExampleBean {

    private ExampleBean() throws NoSuchMethodException {

        // Kick off a thread to update from
        // the Database every 12 hours
        ArrayList parms = new ArrayList();
        Object[] args   = new Object[0];

        TimedMethodInvoker tmi = new TimedMethodInvoker(this, "RefreshDB", parms, args,
                                                        TimedMethodInvoker.SIX_HOURS);
        Thread t = new Thread(tmi);
        t.setDaemon(true);
        t.start();

    }


    // Static method for refreshing the products HashMap
    public static void RefreshDB() {

        // Create a HashMap of HashMaps keyed by product ID
        String sql = "SELECT * FROM myTable";

        try {

            // Do database lookup & retrieve info...

        }
        catch ( Exception ex ) {
            System.err.println("Exception in ExampleBean.RefreshDB(): " + ex.getMessage());
        }

        return;
    }
}