- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the equivalent of Java long in the context of MySQL variables?
The equivalent of Java long in the context of MySQL variables is BigInt.
In Java, the long datatype takes 8 bytes while BigInt also takes the same number of bytes.
Demo of Java long
Here is the demo of Java long −
public class JavaLongDemo { public static void main(String[]args) { long kilometer = 9223372036854775807L; System.out.println("The largest positive value for long range:"+kilometer); } }
The following is the output −
Demo of BigInt
Let us see an example of BigInt type in MySQL. The following is the query to create a table with field set as BigInt −
mysql> create table BigIntDemo −> ( −> Kilometer BigInt −> ); Query OK, 0 rows affected (0.74 sec)
Inserting some records in the table. The query is as follows −
mysql> insert into BigIntDemo values(9223372036854775807); Query OK, 1 row affected (0.19 sec)
Now you can check whether the above record is inserted or not. The select query is as follows −
mysql> select *from BigIntDemo;
The following is the output −
+---------------------+ | Kilometer | +---------------------+ | 9223372036854775807 | +---------------------+ 1 row in set (0.00 sec)
- Related Articles
- What is the equivalent of EXCEPT in MySQL?
- What is the equivalent of C# namespace in Java?
- What is the Java equivalent to MySQL's smallint?
- What is the equivalent of Java static methods in Kotlin?
- What is the scope of local variables in Java?
- What is the PHP equivalent of MySQL's UNHEX()?
- What is the PHP stripos() equivalent in MySQL?
- What is the equivalent of Java static final fields in Kotlin?
- Python Context Variables
- What is the MySQL SELECT INTO Equivalent?
- What are the properties of MySQL user variables?
- What is the C++ equivalent of sprintf?
- What is Python equivalent of the ! operator?
- What is the equivalent of SQL “like” in MongoDB?
- What is the difference between class variables and instance variables in Java?

Advertisements