InterBase 7.1 DataType to InterClient 4.0 Type mappings

By: Aaron Ruddick

Abstract: Datatype bindings between InterBase and Java types

InterBase 7.1 DataType to JDBC DataType Map

Dialect 3 Datatype Mappings

The following table defines the bindings between InterBase SQL datatypes and Java Object Type mappings. All SQL compliant InterBase datatypes are fully supported by InterClient 4.0. All Java client applications should consider using this table for ResultSet data retrieval using the ResultSet.getXXX methods.

InterBase Type

JDBC Type

ResultSet.getXXX

BLOB TYPE 0BLOB java.sql.Blob
BLOB TYPE 1BLOB java.lang.String
BLOB TYPE -1BLOB java.sql.Blob
BLOB TYPE -2BLOB java.sql.Blob
CHARCHAR java.lang.String
VARCHAR(n)VARCHAR java.lang.String
DATEDATE java.sql.Date
TIMETIME java.sql.Time
TIMESTAMPTIMESTAMP java.sql.Timestamp
BOOLEANBOOLEAN java.lang.Boolean
SMALLINTSMALLINT java.lang.Integer
INTEGERINTEGER java.lang.Integer
FLOATFLOAT java.lang.Float
DOUBLE PRECISIONDOUBLE PRECISION java.lang.Double
NUMERIC(1,0)SMALLINT java.lang.Integer
NUMERIC(5,0)INTEGER java.lang.Integer
NUMERIC(10,0)NUMERIC java.math.BigDecimal
NUMERIC(18,0)NUMERIC java.math.BigDecimal
NUMERIC(1,1)NUMERIC java.math.BigDecimal
NUMERIC(5,5)NUMERIC java.math.BigDecimal
NUMERIC(10,5)NUMERIC java.math.BigDecimal
NUMERIC(18,3)NUMERIC java.math.BigDecimal
DECIMAL(1,0)INTEGER java.lang.Integer
DECIMAL(5,0)INTEGER java.lang.Integer
DECIMAL(10,0)DECIMAL java.math.BigDecimal
DECIMAL(18,0)DECIMAL java.math.BigDecimal
DECIMAL(1,1)DECIMAL java.math.BigDecimal
DECIMAL(5,5)DECIMAL java.math.BigDecimal
DECIMAL(10,5)DECIMAL java.math.BigDecimal
DECIMAL(18,3)DECIMAL java.math.BigDecimal


Dialect 1 Datatype Mappings

InterBase Type

JDBC Type

ResultSet.getXXX

BLOB TYPE 0BLOB java.sql.Blob
BLOB TYPE 1BLOB java.lang.String
BLOB TYPE -1BLOB java.sql.Blob
BLOB TYPE -2BLOB java.sql.Blob
CHARCHAR java.lang.String
VARCHAR(n)VARCHAR java.lang.String
DATETIMESTAMP java.sql.Timestamp
TIMESTAMPTIMESTAMP java.sql.Timestamp
BOOLEANBOOLEAN java.lang.Boolean
SMALLINTSMALLINT java.lang.Integer
INTEGERINTEGER java.lang.Integer
FLOATFLOAT java.lang.Float
DOUBLE PRECISIONDOUBLE PRECISION java.lang.Double
NUMERIC(1,0)SMALLINT java.lang.Integer
NUMERIC(5,0)INTEGER java.lang.Integer
NUMERIC(10,0)DOUBLE PRECISION java.lang.Double
NUMERIC(18,0)DOUBLE PRECISION java.lang.Double
NUMERIC(1,1)NUMERIC java.math.BigDecimal
NUMERIC(5,5)NUMERIC java.math.BigDecimal
NUMERIC(10,5)NUMERIC java.math.BigDecimal
NUMERIC(18,3)NUMERIC java.math.BigDecimal
DECIMAL(1,0)INTEGER java.lang.Integer
DECIMAL(5,0)INTEGER java.lang.Integer
DECIMAL(10,0)DOUBLE PRECISION java.lang.Double
DECIMAL(18,0)DOUBLE PRECISION java.lang.Double
DECIMAL(1,1)DECIMAL java.math.BigDecimal
DECIMAL(5,5)DECIMAL java.math.BigDecimal
DECIMAL(10,5)NUMERIC java.math.BigDecimal
DECIMAL(18,3)NUMERIC java.math.BigDecimal

Map your own table

To get more extensive datatype mappings on your own tables, try the following methods:

  • ResultSetMetaData.getColumnName(col_number)
  • Use this to get the metadata name for specified column.
  • ResultSetMetaData.getColumnTypeName(col_number)
  • Use this to get the JDBC/SQL type name of specified column.
  • ResultSetMetaData.getColumnType(col_number)
  • Use this to get the numeric JDBC type of specified column.
  • ResultSetMetaData.getPrecision(col_number)
  • Use this to get maximum precision of specified column.
  • ResultSetMetaData.getScale(col_number)
  • Use this to get the scale of specified column.
  • ResultSetMetaData.getColumnClassName(col_number)
  • Use this to get the Class name of the Java class to which the specified column will be mapped.
  • ResultSet.getObject(col_number).getClass().getName()
  • This is a nice way to get the 'true' mapping of each column in your table.

Server Response from: ETNASC03