public Game getGame(String uuid) {     

        Game result = null; 
        Connection con = null;
        PreparedStatement statement = null;        
        ResultSet rs = null;         
        
        try {
            con = getConnection();

            if (con != null) {
                statement = con.prepareStatement(
                    "select" +
                    "	g.game_id," +
                    "	w.name as whitename," +
                    "	w.titles as whitetitles," +
                    "	b.name as blackname," +
                    "	b.titles as blacktitles," +
                    "	g.whiterating," +
                    "	g.blackrating," +
                    "	g.date as datetime," +
                    "	g.wildnumber," +
                    "	g.basetime," +
                    "	g.increment," +
                    "	g.result_code as result," +
                    "	ARRAY(select move from move where game_id = g.game_id order by ply asc) as moves " +
                    "from " +
                    "	game g " +
                    "	inner join player w " +
                    "		on g.white_id = w.player_id" +
                    "	inner join player b" +
                    "		on g.black_id = b.player_id " +
                    "where " +
                    "	game_uuid = ?::uuid");                
                statement.setString(1,uuid);
                
                rs = statement.executeQuery(); 

                if (rs.next()) { 
                    result = new Game();
                    
                    result.setGameId(rs.getLong("game_id"));
                    result.setWhiteName(rs.getString("whitename"));
                    result.setWhiteTitles(rs.getString("whitetitles"));
                    result.setBlackName(rs.getString("blackname"));
                    result.setBlackTitles(rs.getString("blacktitles"));
                    result.setWhiteRating(rs.getInt("whiterating"));
                    result.setBlackRating(rs.getInt("blackrating"));
                    result.setDate(rs.getString("datetime"));
                    result.setWildNumber(rs.getInt("wildnumber"));
                    result.setBaseTime(rs.getInt("basetime"));
                    result.setIncrement(rs.getInt("increment"));
                    result.setResult(rs.getString("result"));
                    
                    for (Integer move  : (Integer[])rs.getArray("moves").getArray()) { 
                        result.addMove(Utils.convertMove(move));
                    }                    
                }
            } else {                
            }
        } catch (SQLException | NamingException e) {   
            System.out.println(e.getMessage());
        } finally {
            try {
                if (rs != null) 
                    rs.close();
                if (statement != null) 
                    statement.close();
                if (con != null)
                    con.close();
            } catch (SQLException e) {            
            }                          
        }
        return result; 
    }