常见数据库字段类型与java.sql.Types的对应
常见数据库字段类型与java.sql.Types的对应
无知的小孩 发表于1年前
常见数据库字段类型与java.sql.Types的对应
  • 发表于 1年前
  • 阅读 12
  • 收藏 1
  • 点赞 0
  • 评论 0

腾讯云 十分钟定制你的第一个小程序>>>   

摘要: 常见数据库字段类型与java.sql.Types的对应

public final static int BIT   =  -7; 
public final static int TINYINT  =  -6; 
public final static int SMALLINT =   5; 
public final static int INTEGER  =   4; 
public final static int BIGINT   =  -5; 
public final static int FLOAT   =   6; 
public final static int REAL   =   7; 
public final static int DOUBLE   =   8; 
public final static int NUMERIC  =   2; 
public final static int DECIMAL  =   3; 
public final static int CHAR  =   1; 
public final static int VARCHAR  =  12; 
public final static int LONGVARCHAR  =  -1; 
public final static int DATE   =  91; 
public final static int TIME   =  92; 
public final static int TIMESTAMP  =  93; 
public final static int BINARY  =  -2; 
public final static int VARBINARY  =  -3; 
public final static int LONGVARBINARY  =  -4; 
public final static int NULL  =   0; 
public final static int OTHER  = 1111; 
public final static int JAVA_OBJECT         = 2000; 
public final static int DISTINCT            = 2001; 
public final static int STRUCT              = 2002; 
public final static int ARRAY               = 2003; 
public final static int BLOB                = 2004; 
public final static int CLOB                = 2005; 
public final static int REF                 = 2006; 
public final static int DATALINK = 70; 
public final static int BOOLEAN = 16; 
public final static int ROWID = -8; 
public static final int NCHAR = -15; 
public static final int NVARCHAR = -9; 
public static final int LONGNVARCHAR = -16; 
public static final int NCLOB = 2011; 
public static final int SQLXML = 2009; 

 

Oracle与java.sql.Types的对应 

Oracle                                java.sql.Types 
blob                                     blob 
char                                     char 
clob                                     clob 
date                                    date 
number                               decimal 
long                                     varbinary 
nclob,nvarchar2                   other 
smallint                                smallint 
timestamp                            timstamp 
raw                                      varbinary 
varchar2                               varchar 

Sql server与java.sql.Types的对应 

Sql server                           java.sql.Types 
   bigint (2005,2008)                bigint 
   timstamp,binary                    binary 
   bit                                         bit 
   char,nchar,unqualified          char 
   datetime                               date 
   money,smallmoney,decimal  decimal 
   float (2005,2008)                  double 
   float(2000)                            float 
   int                                          integer 
   image                                    longvarbinary 
   text,ntext,xml                        longvarchar 

    numeric                                 numeric 
    real                                       real 
    smallint                                smallint 
    datetime,smalldatetime       timestamp 
    tinyint                                  tinyint 
    varbinary                             varbinay 
    nvarchar,varchar                 varchar 

DB2与java.sql.Types的对应 

bigint                                       bigint 
   blob                                      blob 
   character,graphic                 char 
   clob                                      clob 
   date                                     date 
   decimal                                decimal 
   double                                 double 
    integer                               integer 
    longvargraphic                   longvarchar 
    longvarchar 

real                                        real 
smallint                                 smallint 
time                                      time 
timestamp                            timestamp 
vargraphic                            varchar 
varchar 

MySQL与java.sql.Types的对应 

MySQL                          java.sql.Types 
  bigint                              bigint 
   tinyblob                         binary 
   bit                                  bit 
   enum,set,char               char 
   date,year                      date 
   decimal,numeric            decimal 
   double,real                   double 
   mediumint,int                integer 
   blob,mediumblob           blob 
   longblob 
   float                               real 

smallint                           smallint 
   time                             time 
   timestamp,datetime     timestamp 
   tinyint                           tinyint 
   varbinary,binary           varbinay 
   varchar,tinytext,text     varchar 
Sybase与java.sql.Types的对应 

Sybase                            java.sql.Types 
   binary                                 binary 
   bit                                       bit 
   char,nchar,                            char 
   money,smallmoney,decimal    decimal 
   float                                     double 
    int                                       integer 
   image                                    longvarbinary 
   text                                      longvarchar 
numeric                                   numeric 
    real                                     real 
    smallint                              smallint 
    datetime,smalldatetime     timestamp 
    tinyint                                 tinyint 
    varbinar,timestamp            varbinay 
    nvarchar,varchar ,sysname   varchar 

共有 人打赏支持
粉丝 2
博文 50
码字总数 14706
×
无知的小孩
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
* 金额(元)
¥1 ¥5 ¥10 ¥20 其他金额
打赏人
留言
* 支付类型
微信扫码支付
打赏金额:
已支付成功
打赏金额: