Product Documentation

FairCom JDBC Developer's Guide

Previous Topic

Next Topic

Supported Data Types

The FairCom DB SQL JDBC Driver supports standard JDBC mapping of JDBC types to corresponding Java types.

In the JDBC methods CallableStatement.get..XXX() and PreparedStatement.set...XXX() methods, XXX is a Java type:

  • For ...setXXX() methods, the driver converts the Java type to the FairCom DB SQL JDBC type shown in the following table before sending it to the database.
  • For ...getXXX() methods, the driver converts the FairCom DB SQL JDBC type returned by the database to the Java type shown in “Mapping Between JDBC and Java Data Types” before returning it to the ...getXXX() method.

Mapping Between Java and JDBC Data Types

Java Type

JDBC type

Java Type

JDBC type

String

VARCHAR or LONGVARCHAR

float

REAL

java.math.BigDecimal

NUMERIC

double

DOUBLE

boolean

BIT

byte[]

VARBINARY or
LONGVARBINARY

byte

TINYINT

java.sql.Date

DATE

short

SMALLINT

java.sql.Time

TIME

int

INTEGER

java.sql.Timestamp

TIMESTAMP

long

BIGINT

 

 

Mapping Between JDBC and Java Data Types

JDBC type

Java type

JDBC type

Java type

CHAR

String

REAL

float

VARCHAR

String

FLOAT

double

LONGVARCHAR

String

DOUBLE

double

NUMERIC

java.math.BigDecimal

BINARY

byte[]

DECIMAL

java.math.BigDecimal

VARBINARY

byte[]

BIT

boolean

LONGVARBINARY

byte[]

TINYINT

byte

DATE

java.sql.Date

SMALLINT

short

TIME

java.sql.Time

INTEGER

int

TIMESTAMP

java.sql.Timestamp

BIGINT

long

 

 

TOCIndex