Datatype - Conversion between Java, Oracle, SQL Server and DB2

Card Puncher Data Processing

About

Datatype conversions between Java, Oracle, Microsoft SQL Server and DB2.

Java Oracle Microsoft SQL Server DB2
java.lang.String varchar2(255) nvarchar(50) varchar(255)
int number(20,0)
long number(20,0) int integer
float number(20,5) float float
double number(30,0) float double
byte number(10,0) smallint smallint
char char(1) char char
short number(10,0) int integer
boolean number(1,0) bit bit
java.util.Date date
java.io.Serializable blob varbinary varchar for bit data

This conversions have been found here:

owb_home\j2ee\home\config\database-schemas

and you have also:

  • informix,
  • hypersonic,
  • ms-access,
  • postgresql,
  • and sybase
Kafka Schema Type MySQL Oracle PostgreSQL SQLite SQL Server
INT8 TINYINT NUMBER(3,0) SMALLINT NUMERIC TINYINT
INT16 SMALLINT NUMBER(5,0) SMALLINT NUMERIC SMALLINT
INT32 INT NUMBER(10,0) INT NUMERIC INT
INT64 BIGINT NUMBER(19,0) BIGINT NUMERIC BIGINT
FLOAT32 FLOAT BINARY_FLOAT REAL REAL REAL
FLOAT64 DOUBLE BINARY_DOUBLE DOUBLE PRECISION REAL FLOAT
BOOLEAN TINYINT NUMBER(1,0) BOOLEAN NUMERIC BIT
STRING VARCHAR(256) NCLOB TEXT TEXT VARCHAR(MAX)
BYTES VARBINARY(1024) BLOB BYTEA BLOB VARBINARY(MAX)
‘Decimal’ DECIMAL(65,s) NUMBER(*,s) DECIMAL NUMERIC DECIMAL(38,s)
‘Date’ DATE DATE DATE NUMERIC DATE
‘Time’ TIME(3) DATE TIME NUMERIC TIME
‘Timestamp’ TIMESTAMP(3) TIMESTAMP TIMESTAMP NUMERIC DATETIME2

Documentation / Reference





Discover More
Java Conceptuel Diagram
Java - (Data Type|Type)

data type in the java world. The Java programming language is statically-typed, which means that all variables must first be declared before they can be used. The language supports four kinds...
Regexp
What is Grok? and example

Grok is an extension of regular expressions that supports expressions as variables (so they can be reused) In this example, we will construct an expression that matches the part of a string time...



Share this page:
Follow us:
Task Runner