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
<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"/> <result 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 property="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>
JDBC Type Java Type
CHAR String
VARCHAR String
LONGVARCHAR String
NUMERIC java.math.BigDecimal
DECIMAL java.math.BigDecimal
BIT boolean
BOOLEAN boolean
TINYINT byte
SMALLINT short
INTEGER int
BIGINT long
REAL float
FLOAT double
DOUBLE double
BINARY byte[]
VARBINARY byte[]
LONGVARBINARY byte[]
DATE java.sql.Date
TIME java.sql.Time
TIMESTAMP java.sql.Timestamp
CLOB Clob
BLOB Blob
ARRAY Array
DISTINCT mapping of underlying type
STRUCT Struct
REF Ref
DATALINK java.net.URL[color=red][/color]
用mybatis generator生成代碼後,執行查詢語句時,oracle裏的Date類型字段只精確到年月日,後面時分秒都爲零。java
jdbcType="DATE"時候,存入到數據庫中的字段只有年月日!sql
後來發現是jdbcType問題,改爲 jdbcType="TIMESTAMP" 就能夠。(原先默認生成時是jdbcType="DATE")數據庫
地址:mybatis
http://otndnld.oracle.co.jp/document/products/oracle10g/102/doc_cd/java.102/B19275-03/datacc.htm#BHCJBJCCoracle
SQL數據類型 | JDBC類型代碼 | 標準的Java類型 | Oracle擴展的Java類型 |
---|---|---|---|
1.0標準的JDBC類型:app |
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2.0標準的JDBC類型: |
|||
|
|
|
|
|
|
|
|
用戶定義的對象 |
|
|
|
用戶定義的參考 |
|
|
|
用戶定義的集合 |
|
|
|
Oracle擴展: |
|||
|
|
N/A |
|
|
|
N/A |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
u