I am developing a small tool with JavaFX and a PostgreSQL database. My task now is to process a 32-digit digit. I tried it with Long, but its short / small.
I remember that Postgres grumbled because I did not use the correct data type, so I first ask here before changing all the lines again affected by this problem.
I am not mathematically with this number, but I need to keep zero.
What is your advice? String, BigInteger?
Example 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;
return l;
}
source
share