Cast bigint to long
If this is MySql, you should probably use java.math.BigDecimal
.
See the table at Java, JDBC and MySQL Types.
have you tried casting your value to BigInteger first and then get the long value with longValue()? It should work. And aioobe is right, check for null values also.
cheers!