Java long to MySql

JavaMysql

Java Problem Overview


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

Java Solutions


Solution 1 - Java

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

Solution 2 - Java

Java long max value is positive: 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 BIGINT which is equal to UNSIGNED BIGINT(20)

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionsykerView Question on Stackoverflow
Solution 1 - JavaCrozinView Answer on Stackoverflow
Solution 2 - JavaFırat KÜÇÜKView Answer on Stackoverflow