我正在实现一个数据库应用程序,我将使用JavaDB和MySQL作为数据库.我的表中有一个ID列,其类型为整数,我使用数据库auto_increment-function作为值.
但是当我获得超过2(或4)亿个帖子和整数时,会发生什么呢?整数溢出并继续或者是我可以处理的异常抛出?
是的,我可以更改为数据类型,但如何检查何时需要?我认为获取last_inserted_id()函数是有问题的,如果我使用long作为ID列的数据类型.
database integer-overflow auto-increment lastinsertid
auto-increment ×1
database ×1
integer-overflow ×1
lastinsertid ×1