code: private void populateAccess() throws SQLException {
  
      PreparedStatement statement = null ;
      try {
        statement = connection.prepareStatement(
            "INSERT INTO Access(url, referrer, time)" +
            " VALUES (?, ?, ?)");
  
        Random random = new Random();
  
        int time = random.nextInt(50) + 50;
  
        final int PROBABILITY_PRECISION = 100; //  1 / 100 
        final int NEW_PAGE_PROBABILITY  = 15;  //  15 / 100
  
  
        //Pages in the site :
        String[] pages = {"/a", "/b", "/c", "/d", "/e", "/f", "/g", "/h", "/i", "/j"};
        //linkMatrix[i] is the array of pages(indexes) that page_i links to.  
        int[][] linkMatrix = {{1,5,7}, {0,7,4,6,}, {0,1,7,8}, {0,2,4,6,7,9}, {0,1},
            {0,3,5,9}, {0}, {0,1,3}, {0,2,6}, {0,2,6}};
  
        //a mini model of user browsing a la pagerank
        int currentPage = random.nextInt(pages.length); 
        String referrer = null;
  
        for(int i=0; i<time; i++) {
  
          statement.setString(1, pages[currentPage]);
          statement.setString(2, referrer);
          statement.setLong(3, i);
          statement.execute();
  
          int action = random.nextInt(PROBABILITY_PRECISION);
  
          //go to a new page with probability NEW_PAGE_PROBABILITY / PROBABILITY_PRECISION
          if(action < NEW_PAGE_PROBABILITY) { 
            currentPage = random.nextInt(pages.length); // a random page
            referrer = null;
          }
          else {
            referrer = pages[currentPage];
            action = random.nextInt(linkMatrix[currentPage].length);
            currentPage = linkMatrix[currentPage][action];
          }
        }
        
        connection.commit();
        
      }catch (SQLException ex) {
        connection.rollback();
        throw ex;
      } finally {
        if(statement != null) {
          statement.close();
        }
      }
    }
docs: Populates the Access table with generated records.