0

我的问题是:如何在 MySQL DB 中插入 BigInteger 变量作为 BIGINT?在我看来Java中的preparedstatement对象没有方法支持这种类型?

4

1 回答 1

1

According to this documentation, BIGINT is just a 64-bit integer in MySQL - so use setLong. That should be fine for signed BIGINT types in MySQL. Unfortunately Java doesn't have an "unsigned long" type, so if you have an unsigned BIGINT in your database that could be trickier - you could try still using setLong, and see whether it just overflows in the "natural" way.

于 2012-07-08T19:54:40.110 回答