Recently depressed, the conversion between the underlying type and Java type is unclear, and by the way the information on the Internet lists some types to remind
Mysql
1, integers:
MySQL data type |
Meaning (Signed) |
tinyint (m) |
1 byte range ( -128~127) |
smallint (m) |
2 byte range ( -32768~32767) |
Mediumint (M) |
3 byte range ( -8388608~8388607) |
Int (m) |
4 byte range ( -2147483648~2147483647) |
BigInt (M) |
8 byte Range (18 +-9.22*10 of the X-square) |
2, floating-point type:
MySQL data type |
Meaning |
Float (m,d) |
Single-precision floating-point 8-bit precision (4 bytes) m total number, D decimal place |
Double (m,d) |
Double-precision floating-point 16-bit precision (8 bytes) m total number, D decimal place |
3, fixed point: Decimal (m,d) parameter m represents the total number of digits but less than 65,d less than 30. It is worth noting that floating-point type is the approximate value, fixed-point type actual value
4. Character Type:
MySQL data type |
Meaning |
CHAR (n) |
Fixed length, up to 255 characters |
VARCHAR (n) |
Fixed length, up to 65,535 characters |
Tinytext |
Variable length, up to 255 characters |
Text |
Variable length, up to 65,535 characters |
Mediumtext |
Variable length, up to 2 of 24 square-1 characters |
Longtext |
Variable length, up to 2 of 32 square-1 characters
|
5. Time Type:
MySQL data type |
Meaning |
CHAR (n) |
Fixed length, up to 255 characters |
VARCHAR (n) |
Fixed length, up to 65,535 characters |
Tinytext |
Variable length, up to 255 characters |
Text |
Variable length, up to 65,535 characters |
Mediumtext |
Variable length, up to 2 of 24 square-1 characters |
Longtext |
Variable length, up to 2 of 32 square-1 characters
|
It is important to note that timestamp is updated with other Automatic updates to this data and can be used as an update time
6, binary number: Blob is stored in binary mode, no case, the data can only be read as a whole, blo do not specify a character set.
Basic types of MySQL