I have a table in an SQL database where the values' data type is BIGINT(20), and I need to get those data to my logic in Java for processing.
What should be the appropriate data type in java to store the BIGINT(20) value returned ?
(I thought of using Long but there is BigInteger also, can't figure out what is good or suitable)
It depends on the database server. A Java long
is always implemented as 8 bytes since it is part of the standard.
On MSSQL, the bigint
type is 8 bytes, so it is a perfect match.