Skip to content

JDBC to Java Mappings

berryware edited this page Jun 19, 2020 · 1 revision

#JDBC

java.sql.Types to Java Class Mapping

  • CHAR | String

  • LONGVARCHAR | String

  • VARCHAR | String

  • DECIMAL | BigDecimal

  • NUMERIC | BigDecimal

  • 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 | java.sql.Clob

  • BLOB | java.sql.Blob

  • ARRAY | java.sql.Array

  • REF | java.sql.Ref

  • DISTINCT | Object

  • STRUCT | Object

  • OTHER | Object

  • JAVA_OBJECT | Object

  • DATALINK | java.net.URL

  • BIT | boolean

  • BOOLEAN | boolean

  • ------------------------- JDBC 4.0 -----------------------------------

  •     ROWID | java.sql.RowId
    
  •     NCHAR | String
    
  •  NVARCHAR | String
    
  • LONGNVARCHAR | String

  •     NCLOB | java.sql.NClob
    
  •    SQLXML | java.sql.SQLXML
    
  • --------------------------JDBC 4.2 -----------------------------

  •           REF_CURSOR | java.sql.ResultSet
    
  •   TIME_WITH_TIMEZONE | java.time.OffsetTime
    
  • TIMESTAMP_WITH_TIMEZONE | java.time.OffsetDateTime

Java class to JDBC Method Mapping