Chapter 29 Managing Persistent Component State


Supported Java, IDL, and JDBC/SQL types

Table 29-3 lists the Java, IDL, and JDBC/SQL types that Jaguar supports for persistent storage using mapped fields. Types on one row are equivalent. The JDBC/SQL column lists the java.sql.Types constants that the storage component uses to bind to the database column. When creating tables, ensure that each column's type is compatible with the JDBC/SQL type that corresponds to the mapped Java field.

Table 29-3: Supported Java, IDL, and JDBC datatypes

Java field type

CORBA IDL field type

JDBC/SQL column type

boolean

boolean

TINYINT

char

char

CHAR

byte

octet

TINYINT

short

short

SMALLINT

(N/A)

unsigned short

SMALLINT

int

long

INTEGER

(N/A)

unsigned long

INTEGER

long

long long

BIGINT

(N/A)

unsigned long long

BIGINT

float

float

REAL

double

double

FLOAT

(N/A)

string

VARCHAR

(N/A)

BCD::Binary

VARBINARY

(N/A)

BCD::Decimal

DECIMAL

(N/A)

BCD::Money

DECIMAL

(N/A)

MJD::Date

DATE

(N/A)

MJD::Time

TIME

(N/A)

MJD::Timestamp

TIMESTAMP

java.lang.String

CtsComponents::StringValue

VARCHAR

byte[]

CtsComponents::BinaryValue

VARBINARY

java.lang.Boolean

CtsComponents::BooleanValue

TINYINT

java.lang.Character

CtsComponents::CharValue

CHAR

java.lang.Byte

CtsComponents::OctetValue

TINYINT

java.lang.Short

CtsComponents::ShortValue

SMALLINT

(N/A)

CtsComponents::UShortValue

SMALLINT

java.lang.Integer

CtsComponents::LongValue

INTEGER

(N/A)

CtsComponents::ULongValue

INTEGER

java.lang.Long

CtsComponents::LongLongValue

BIGINT

java.lang.Float

CtsComponents::FloatValue

REAL

java.lang.Double

CtsComponents::DoubleValue

FLOAT

java.lang.BigDecimal

CtsComponents::DecimalValue

DECIMAL

(N/A)

CtsComponents::MoneyValue

DECIMAL

java.lang.Date

CtsComponents::DateValue

DATE

java.lang.Time

CtsComponents::TimeValue

TIME

java.lang.Timestamp

CtsComponents::TimestampValue

TIMESTAMP

Serializable object

(N/A)

VARBINARY

Note   Values that can be null If a field can contain nulls, do not use a primitive type. Instead, use the CtsComponents::TypeValue IDL type and the equivalent Java object type. For example, rather than float, use CtsComponents::FloatValue and java.lang.Float.

 


Copyright © 2000 Sybase, Inc. All rights reserved.