public void go() throws SQLException, IOException, InterruptedException
    {
        stmtGetPlayers.setInt(1, queueId);
        if(!stmtGetPlayers.execute())
                return;
        
        ResultSet rs = stmtGetPlayers.getResultSet();
        List<PokerBot> bots = new ArrayList<PokerBot>();
        List<QPlayer> qps = new ArrayList<QPlayer>();
        while(rs.next())
        {
            QPlayer qp = new QPlayer(rs);
            qps.add(qp);
            bots.add(qp.getPokerBot());
        }
        
        // play a tournament
        if(tournamentOrCash)
        {
        	// determine the number of places paid
            int totalPlayers = bots.size();
            if(placesPaid == 0)
            	placesPaid = computePlacedPaid(totalPlayers);
            
            // run a tournament and store the results
            HashMap<String, Integer> finalRanking = runTournament(new ArrayList<PokerBot>(bots));
            for(int i = 0; i < qps.size(); i++)
            {
                QPlayer qp = qps.get(i);
                int finishRank = finalRanking.get(qp.getPokerBot().getName());
                qp.storeResultTournament(totalPlayers, finishRank);
            }
        }
        // play a cash game
        else
        {
            MatchPlayer engine = new MatchPlayer(new ArrayList<PokerBot>(bots), gameType, startingStack);
            engine.finishSetup(true);
            ArrayList<String> results = engine.run(numberOfHands, 0);
            for(int i = 0; i < qps.size(); i++)
            {
                QPlayer qp = qps.get(i);
                String botName = qp.getPokerBot().getName();
                for(int j = 0; j < results.size(); j++)
                {
                    String[] subStrings = results.get(j).split(" ");
                    if(subStrings[0].equals(botName) && subStrings[1].equals("gainLoss"))
                        qp.storeResultCash(Integer.parseInt(subStrings[2]), numberOfHands);
                }
            }
        }
        
        Thread.sleep(200);
        System.exit(0);
    }