public void CloseBets(String team) {
    	Connection con = null;
    	PreparedStatement pst = null;
    	ResultSet rs = null;
    	boolean BlueWin = (team == "blue") ? true : false;
    	
    	try {
    		con = DriverManager.getConnection(url, user, password);
    		pst = con.prepareStatement("SELECT * FROM Players");
    		rs = pst.executeQuery();
    		//Find bets
    		while (rs.next()) {
    			if (rs.getInt("Bet") == 0) {
    				continue;
    			}
    			//Handle bet
    			else  {
    				String name = rs.getString("Name");
    				Integer bet = (BlueWin) ? rs.getInt("Bet") : -(rs.getInt("Bet"));
    				Integer gold = rs.getInt("Gold") + bet;
    				SetPlayerGold(name, gold);
    				SetPlayerBet(name, 0);
    			}
    		}
    	} catch (SQLException ex) {
    		Logger lgr = Logger.getLogger(MySQLAccess.class.getName());
            lgr.log(Level.SEVERE, ex.getMessage(), ex);
    	}
    	finally {

            try {
                if (pst != null) {
                    pst.close();
                }
                if (con != null) {
                    con.close();
                }

            } catch (SQLException ex) {
                Logger lgr = Logger.getLogger(MySQLAccess.class.getName());
                lgr.log(Level.SEVERE, ex.getMessage(), ex);
            }
        }		
    }