mysql jdbc: what is column size for BIGINT?
ResultSet columns = databaseMetaData.getColumns("foo", "bar", "table", "id");
int columnSize = columns.getInt(7);
Q: What is column size for BIGINT?
BIGINT datatype is a 64-byte signed integer. From a JDBC resultset, that can be handled in Java as a
With the unsigned variant, the MySQL
BIGINT UNSIGNED dataype, that could be handled as
java.math.BigInteger. (The maximum value of MySQL
BIGINT UNSIGNED exceeds the maximum value of Java
Q: Is it 19 bytes?
The longest string value that MySQL will return for a BIGINT would be
'-9223372036854775808', which is 20 characters. (An extra character is required for the minus sign.)
BIGINT UNSIGNED, the longest string value that MySQL will return in a resultset would be 19 characters.
In terms of storage in the MySQL database, the BIGINT datatype requires eight bytes.