Mysql
************************************
Current column ClassName ColumnType displaysize TypeName
0:java.lang.integer Columntype:4 One Integer
1:java.lang.integer columntype:-6 4 TINYINT
2:java.lang.string Columntype:12 0 UNKNOWN
3:java.lang.boolean columntype:-7 1 TINYINT
4:java.lang.integer Columntype:5 6 SMALLINT
5:java.lang.integer Columntype:4 9 Mediumint
6:java.lang.integer Columntype:4 One Integer
7:java.lang.long columntype:-5 BIGINT
8:java.lang.double Columntype:8 Double
9:java.lang.double Columntype:8 Double
10:java.lang.float Columntype:7 Float
11:java.lang.string Columntype:12 UNKNOWN
12:java.lang.string Columntype:12 UNKNOWN
13:java.lang.string columntype:1 CHAR
14:java.lang.string Columntype:12-VARCHAR
15:java.sql.date columntype:91 Date
16:java.sql.time columntype:92 8 Time
17:java.sql.date columntype:91 4 year
18:java.sql.timestamp columntype:93 Timestamp
19:java.sql.timestamp columntype:93 DATETIME
: [B columntype:-3 255 Tinyblob
: [B columntype:-4 65535 BLOB
: [B columntype:-4 16777215 Mediumblob
at: [B columntype:-4-1 BLOB
24:java.lang.string Columntype:12 255 Tinyblob
25:java.lang.string columntype:-1 65535 TEXT
26:java.lang.string columntype:-1 16777215 Mediumblob
27:java.lang.string columntype:-1-1 TEXT
28:java.lang.string columntype:1 3 CHAR
29:java.lang.string columntype:1 3 CHAR
Sql server
***********************************
0:java.lang.integer Columntype:4 int Identity
1:java.lang.long columntype:-5 bigint
2:byte[] Columntype:-2
3:java.lang.boolean columntype:-7 1 bit
4:java.lang.string Columntype:1 Char
5:java.sql.timestamp columntype:93 datetime
6:java.sql.timestamp columntype:93 datetime
7:java.math.bigdecimal columntype:3 Decimal
8:java.lang.double Columntype:6 Float
9:byte[] columntype:-4 2147483647 image
10:java.math.bigdecimal Columntype:3
11:java.lang.string columntype:1 NCHAR
12:java.lang.string columntype:-1 1073741823 ntext
13:java.math.bigdecimal Columntype:2 Numeric
14:java.lang.string columntype:12 nvarchar
15:java.lang.float Columntype:7 Real
16:java.sql.timestamp columntype:93 smalldatetime
17:java.lang.integer Columntype:5 6 smallint
18:java.math.bigdecimal Columntype:3 smallmoney
19:java.lang.string Columntype:12 8000 sql_variant
20:java.lang.string columntype:-1 2147483647 Text
21:byte[] columntype:-2 Timestamp
22:java.lang.integer columntype:-6 3 tinyint
23:java.lang.string columntype:1 uniqueidentifier
24:byte[] columntype:-3 varbinary
25:java.lang.string columntype:12-varchar
***********************************
MySQL supports a large number of column types, which can be divided into 3 categories: numeric types, date and time types, and string (character) types. This section first gives an overview of the available types, and summarizes each column class
And then provide a more detailed description of the nature of the type in each class. An overview is intentionally simplified, and more detailed instructions should take into account additional information about a particular column type, such as the allow for which you can specify a value
Format.
The column types supported by MySQL are listed below. The following code letters are used in the description:
M
Indicates the maximum display size. The largest legal display size is 255.
D
Applies to floating-point types and indicates the number of digits following the decimal point. The maximum possible value is 30, but should be less than M-2.
Square brackets ("[" and "]") indicate the part of the optional type modifier.
Note that if you specify one for Zerofill,mysql, the unsigned property will be automatically added for that column.
tinyint[(M)] [UNSIGNED] [Zerofill]
A very small integer. The signed range is 128 to 127, the unsigned range is 0 to 255.
smallint[(M)] [UNSIGNED] [Zerofill]
A small integer. The signed range is 32768 to 32767, the unsigned range is 0 to 65535.
mediumint[(M)] [UNSIGNED] [Zerofill]
A medium-sized integer. The signed range is 8388608 to 8388607, the unsigned range is 0 to 16777215.
int[(M)] [UNSIGNED] [Zerofill]
A normal size integer. The signed range is 2147483648 to 2147483647, the unsigned range is 0 to 4294967295.
integer[(M)] [UNSIGNED] [Zerofill]
This is a synonym for int.
bigint[(M)] [UNSIGNED] [Zerofill]
A large integer. The signed range is 9223372036854775808 to 9223372036854775807, the unsigned range is 0 to
18446744073709551615. Note that all arithmetic operations are done with a signed bigint or double value, so you should not use greater than
9223372036854775807 (63-bit) signed large integer, except bit function! Note that when two parameters are an integer value,-, +, and * will use the bigint
Operation! This means that if you multiply by 2 large integers (or from a function that returns integers), you can get unexpected results if the result is greater than 9223372036854775807. A floating-point
Numbers, which cannot be unsigned, are of a single-precision floating-point number, whose precision can be <= 24, a double-precision float, which is between 25 and 53, these types such as float and double class
Type is described below immediately. Float (X) has the same range as the corresponding float and double, but the display dimensions and scale are undefined. In MySQL3.23, this is
A real floating-point value. In earlier versions of MySQL, FLOAT (precision) always had 2 decimal places. This syntax is provided for ODBC compatibility.
float[(m,d)] [Zerofill]
A small (single-precision) floating-point number. cannot be unsigned. The allowable values are -3.402823466E+38 to -1.175494351e-38,0 and
1.175494351E-38 to 3.402823466E+38. M is the number of digits that display the width and d is a decimal. Float with no parameters or a parameter with <24 represents a
A single precision floating point number.
double[(m,d)] [Zerofill]
A normal-size (double-precision) floating-point number. cannot be unsigned. The allowable value is -1.7976931348623157E+308
To -2.2250738585072014E-308, 0 and 2.2250738585072014E-308 to
1.7976931348623157E+308. M is the display width and d is the number of decimal digits. A double or float (x) without a parameter (< = x < = 53) represents a two-precision floating-point number.
DOUBLE precision[(m,d)] [Zerofill]
real[(m,d)] [Zerofill]
These are double synonyms.
decimal[(M[,d]) [Zerofill]
A floating-point number that is uncompressed (unpack). cannot be unsigned. Behaves like a char column: "Uncompressed" means that the number is stored as a string, and each bit of the value uses one character. Small
Number, and for negative numbers, the "-" symbol is not calculated in M. If D is 0, the value will have no decimal point or fractional part. The maximum range of decimal values is the same as double, but for a given
The decimal column, the actual range can be limited by the choice of M and D. If D is omitted, it is set to 0. If M is omitted, it is set to 10. Note that the
MySQL3.22, the M parameter includes the symbol and the decimal point.
NUMERIC (M,D) [Zerofill]
This is a synonym for decimal.
DATE
A date. The scope of support is ' 1000-01-01′ to ' 9999-12-31′. MySQL Displays the date value in ' YYYY-MM-DD ' format, but allows you to
Assigns a value to the date column using a string or a number.
Datetime
A date and time combination. The scope of support is ' 1000-01-01 00:00:00′ to ' 9999-12-3123:59:59′. MySQL with ' yyyy-
MM-DDHH:MM:SS ' format to display datetime values, but allows you to assign a value to a datetime column using a string or a number.
timestamp[(M)]
A time stamp. The range is ' 1970-01-0100:00:00′ to 2037 ' sometime. MySQL to
YYYYMMDDHHMMSS, YYMMDDHHMMSS, YYYYMMDD, or YYMMDD format to display the timestamp value, depending on whether M is 14 (or
omitted), 12, 8, or 6, but allows you to assign a value to the timestamp column using a string or a number. A timestamp column for recording an INSERT or update operation
The date and time of the work is useful, because if you do not assign it yourself, it is automatically set to the date and time of the most recent operation. You can set it to the current date and time by assigning it a null value
Room
Time
A time. The range is ' -838:59:59′ to ' 838:59:59′. MySQL displays the time value in ' HH:MM:SS ' format, but allows you to use a string or
The number assigns the value to the time column.
year[(2|4)]
A 2-or 4-digit year (the default is 4-bit). The allowed values are 1901 to 2155, and 0000 (4-bit year format), if you use 2
Bits, 1970-2069 (70-69). MySQL Displays the year value in yyyy format, but allows you to assign a string or numeric value to the year column. (Year type
Is the new type in MySQL3.22. )
CHAR (M) [BINARY]
A fixed-length string that, when stored, always fills the right to the specified length with a space. The range of M is 1~255 characters. When the value is retrieved, the trailing space is deleted. Char values are based on the default character set
Sort and compare in a case-insensitive way, unless a binary keyword is given. Nationalchar (short form nchar) is the Ansisql way to define a char column
The default character set should be used. This is the default for MySQL. Char is an abbreviation for character.
[National] VARCHAR (M) [BINARY]
A variable-length string. Note: When the value is stored, the trailing spaces are deleted (this differs from the ANSI SQL specification). The range of M is 1 ~ 255 characters. The varchar value is based on the default
Character sets are sorted and compared in a case-insensitive manner unless a binary keyword value is given. VARCHAR is an abbreviation for charactervarying.
Tinyblob
Tinytext
A blob or text column with a maximum length of 255 (2^8-1) characters.
Blob
TEXT
A blob or text column with a maximum length of 65535 (2^16-1) characters.
Mediumblob
Mediumtext
A blob or text column with a maximum length of 16777215 (2^24-1) characters.
Longblob
Longtext
A blob or text column with a maximum length of 4294967295 (2^32-1) characters.
ENUM (' value1′, ' value2′,...)
Enumeration. A string object that has only one value, selected from the Value list ' value1′, ' value2′, ..., or null. An enum can have up to 65535
A different value.
SET (' value1′, ' value2′,...)
A collection. A string object that can have 0 or more values, each of which must be from a list of values ' value1′, ' value2′, ... Elected. A set can have a maximum of 64
Members.
Mysql/sql data type correspondence between server and Java
Mysql/sql data type correspondence between server and Java