title: How to handle a 32 digits numeric in Java and PostgreSQL?
body: <p>I'm developing a little tool with JavaFX and a PostgreSQL-database. My task now is to handle a 32 digits numeric. I tried it with Long, but its to short / small.</p>
  
  <p>I remember that Postgres grumbled because I didn't use the correct datatype, that's why I'm asking here first, before I change all lines again affected by this problem.</p>
  
  <p>I do not math with this numeric, but I need to save null within.</p>
  
  <p>What's your advice? String, BigInteger?</p>
  
  <p>Code-Example:</p>
  
  <pre><code>//...
  myObject.setSerialNumber(getLongFromDB(rs, "serialnumber"));
  //...
  
  private static Long getLongFromDB(ResultSet rs, String column) throws SQLException {
      Long l = rs.getLong(column);
      if (rs.wasNull()) l = null; // because getLong is long not Long, I need to know about null
      return l;
  }
  </code></pre>