Correspondence between Javatype and Jdbctype in MyBatis

Source: Internet
Author: User

MyBatis by the included Jdbctype type

BIT FLOAT CHAR TIMESTAMP other UNDEFINED

TINYINT REAL VARCHAR BINARY BLOB NVARCHAR

SMALLINT DOUBLE LongVarChar VARBINARY CLOB NCHAR

INTEGER NUMERIC DATE longvarbinary BOOLEAN NCLOB

BIGINT DECIMAL Time NULL CURSOR

javatype and Jdbctype correspondence and crud examples in Mybatis
<resultmap type= "Java.util.Map" id= "RESULTJCM" > <result property= "fld_number" column= "Fld_number" javaType= "Double" jdbctype= "NUMERIC"/> <result property= "Fld_varchar" column= "Fld_varchar" javatype= "string" jdbctype= " VARCHAR "/> <result property=" fld_date "column=" Fld_date "javatype=" Java.sql.Date "jdbctype=" DATE "/> <res Ult property= "Fld_integer" column= "Fld_integer" javatype= "int" jdbctype= "INTEGER"/> <result property= "FLD_ Double "column=" fld_double "javatype=" Double "jdbctype=" double "/> <result property=" Fld_long "column=" Fld_long "Javatype=" Long "jdbctype=" INTEGER "/> <result property=" Fld_char "column=" Fld_char "javatype=" string "Jdbctype = "CHAR"/> <result property= "Fld_blob" column= "Fld_blob" javatype= "[B" jdbctype= "BLOB"/> <result Proper Ty= "Fld_clob" column= "Fld_clob" javatype= "string" jdbctype= "CLOB"/> <result property= "fld_float" column= "FLD_ Float "javatype=" float "jdbctype=" float"/> <result property=" Fld_timestamp "column=" Fld_timestamp "javatype=" Java.sql.Timestamp "jdbctype=" TIMESTAMP   "/> </resultMap>

  

correspondence between Javatype and jdbctype in Mybatis

    1. JDBC type Java Type
    2. CHAR String
    3. VARCHAR String
    4. LongVarChar String
    5. NUMERIC Java.math.BigDecimal
    6. DECIMAL Java.math.BigDecimal
    7. BIT Boolean
    8. Boolean Boolean
    9. TINYINT byte
    10. SMALLINT Short
    11. INTEGER int
    12. BIGINT Long
    13. REAL float
    14. FLOAT Double
    15. Double Double
    16. BINARY byte[]
    17. VARBINARY byte[]
    18. LongVarBinary byte[]
    19. DATE java.sql.Date
    20. Time Java.sql.Time
    21. TIMESTAMP Java.sql.Timestamp
    22. CLOB CLOB
    23. Blob blob
    24. Array array
    25. DISTINCT mapping of underlying type
    26. struct struct
    27. Ref ref
    28. DATALINK Java.net.url[color=red][/color]

Correspondence between Javatype and Jdbctype in MyBatis

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.