Java 长到 MySql

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3781218/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 04:55:54  来源:igfitidea点击:

Java long to MySql

javamysql

提问by syker

What is the equivalent of a Java long in the context of MySql variables?

在 MySql 变量的上下文中,Java long 的等价物是什么?

采纳答案by Crozin

SIGNED BIGINTis a 8-bytes long integer just like Java's long.

SIGNED BIGINT是一个 8 字节长的整数,就像 Java 的long.

回答by F?rat Kü?üK

Java long max value is positive: 9,223,372,036,854,775,807

Java long 最大值为正: 9,223,372,036,854,775,807

This means for positive only unsigned numbers UNSIGNED BIGINT(19)should be enough or you can just use UNSIGNED BIGINTwhich is equal to UNSIGNED BIGINT(20)

这意味着对于正数,只有无符号数UNSIGNED BIGINT(19)就足够了,或者您可以使用UNSIGNED BIGINT它等于UNSIGNED BIGINT(20)

If you are going to use negative numbers as well BIGINT(19)will be enough.

如果您也打算使用负数BIGINT(19)就足够了。