zoukankan      html  css  js  c++  java
  • Mybatis中jdbcType和javaType、typeHandler的对照关系

     

    JdbcType与Oracle、MySql数据类型对应列表,及

    JdbcType Oracle MySql
    CHAR CHAR CHAR
    VARCHAR VARCHAR VARCHAR
    LONGVARCHAR LONG VARCHAR  
    CLOB CLOB TEXT
    NCHAR NCHAR  
    NVARCHAR    
    NCLOB NCLOB  
    TINYINT   TINYINT
    SMALLINT SMALLINT SMALLINT
    INTEGER INTEGER INTEGER
    BIGINT   BIGINT
    DECIMAL DECIMAL DECIMAL
    DOUBLE NUMBER DOUBLE
    FLOAT FLOAT FLOAT
    REAL REAL REAL
    NUMERIC NUMERIC/NUMBER NUMERIC
    DATE DATE DATE
    TIME   TIME
    TIMESTAMP TIMESTAMP TIMESTAMP/DATETIME
    BLOB BLOB BLOB
    BIT   BIT
    BOOLEAN    
    CURSOR    
    BINARY    
    LONGVARBINARY    
    VARBINARY    
    ARRAY    
    STRUCT    
    OTHER    
    UNDEFINED    
    NULL    

    TypeHandler与java类型、JDBC类型对应表

    类型处理器Java 类型JDBC 类型
    BooleanTypeHandler java.lang.Booleanboolean 数据库兼容的 BOOLEAN
    ByteTypeHandler java.lang.Bytebyte 数据库兼容的 NUMERIC 或 BYTE
    ShortTypeHandler java.lang.Shortshort 数据库兼容的 NUMERIC 或 SHORT INTEGER
    IntegerTypeHandler java.lang.Integerint 数据库兼容的 NUMERIC 或 INTEGER
    LongTypeHandler java.lang.Longlong 数据库兼容的 NUMERIC 或 LONG INTEGER
    FloatTypeHandler java.lang.Floatfloat 数据库兼容的 NUMERIC 或 FLOAT
    DoubleTypeHandler java.lang.Doubledouble 数据库兼容的 NUMERIC 或 DOUBLE
    BigDecimalTypeHandler java.math.BigDecimal 数据库兼容的 NUMERIC 或 DECIMAL
    StringTypeHandler java.lang.String CHARVARCHAR
    ClobReaderTypeHandler java.io.Reader -
    ClobTypeHandler java.lang.String CLOBLONGVARCHAR
    NStringTypeHandler java.lang.String NVARCHARNCHAR
    NClobTypeHandler java.lang.String NCLOB
    BlobInputStreamTypeHandler java.io.InputStream -
    ByteArrayTypeHandler byte[] 数据库兼容的字节流类型
    BlobTypeHandler byte[] BLOBLONGVARBINARY
    DateTypeHandler java.util.Date TIMESTAMP
    DateOnlyTypeHandler java.util.Date DATE
    TimeOnlyTypeHandler java.util.Date TIME
    SqlTimestampTypeHandler java.sql.Timestamp TIMESTAMP
    SqlDateTypeHandler java.sql.Date DATE
    SqlTimeTypeHandler java.sql.Time TIME
    ObjectTypeHandler Any OTHER 或未指定类型
    EnumTypeHandler Enumeration Type VARCHAR-任何兼容的字符串类型,存储枚举的名称(而不是索引)
    EnumOrdinalTypeHandler Enumeration Type 任何兼容的 NUMERIC 或 DOUBLE 类型,存储枚举的索引(而不是名称)。
    InstantTypeHandler java.time.Instant TIMESTAMP
    LocalDateTimeTypeHandler java.time.LocalDateTime TIMESTAMP
    LocalDateTypeHandler java.time.LocalDate DATE
    LocalTimeTypeHandler java.time.LocalTime TIME
    OffsetDateTimeTypeHandler java.time.OffsetDateTime TIMESTAMP
    OffsetTimeTypeHandler java.time.OffsetTime TIME
    ZonedDateTimeTypeHandler java.time.ZonedDateTime TIMESTAMP
    YearTypeHandler java.time.Year INTEGER
    MonthTypeHandler java.time.Month INTEGER
    YearMonthTypeHandler java.time.YearMonth VARCHAR or LONGVARCHAR
    JapaneseDateTypeHandler java.time.chrono.JapaneseDate DATE

     

  • 相关阅读:
    阶乘递归实现
    队列
    1+2+3+...+100用递归实现
    快速排序C语言实现
    js的onfocus,onblur事件
    CSP2021 游记 菜到离谱
    700题复习计划
    [传递闭包] P2881 [USACO07MAR]排名的牛Ranking the Cows
    【笔记】序列分块
    【题解】UVA10930 A-Sequence
  • 原文地址:https://www.cnblogs.com/canger/p/9979606.html
Copyright © 2011-2022 走看看