title: How to get a two-dimensional array from a Postgre using java or jdbcTemplate
body: <p>When I execute such code in the console </p>
  
  <pre><code>SELECT dimensions FROM public."NEWS" WHERE id = 5
  </code></pre>
  
  <p>I get this : (arrays of integers)</p>
  
  <pre><code>{{2560,1707},{2560,1707},{720,960},{1200,1600}}
  </code></pre>
  
  <p>But when I wrote code in java</p>
  
  <pre><code>ArrayList&lt;String[][]&gt; dimensions = new ArrayList&lt;&gt;();
  try {
      PreparedStatement ps =
          dataSource.getConnection().prepareStatement(
                  "SELECT dimensions::varchar[][] FROM public.\"NEWS\" WHERE id = "+id+";");
      ResultSet rs = ps.executeQuery();
      while(rs.next()) {
          dimensions.add((String[][]) rs.getArray(1).getArray());
      }
  } catch (SQLException ignored) {}
  </code></pre>
  
  <p>I got NullPointerException on line: <code>dimensions.add((String[][]) rs.getArray(1).getArray());</code></p>
  
  <p>How to get a two-dimensional array from a Postgre using java or jdbcTemlate from Spring Framework?</p>