SQL/MX Programming Manual for Java

SQLJ Programming
HP NonStop SQL/MX Programming Manual for Java523726-003
3-38
Date-Time Data Types
Date-Time Data Types
The SQL CAST function is not required for the input or output of date-time data types
in SQLJ executable clauses of an SQLJ program. For more information about date-
time data types, see the SQL/MX Reference Manual.
Interval Data Types
Although you can access interval data types as String objects by using JDBC/MX,
customized SQLJ programs cannot access interval data. If an SQLJ program refers to
an interval column in an SQLJ executable clause, a warning occurs during translation,
and an error occurs during customization.
To access interval data types from an SQLJ program:
Use JDBC method calls in a customized SQLJ program to access data from
interval columns.
Do not customize an SQLJ program that has SQLJ executable clauses that refer to
interval columns.
For more information about interval data types, see the SQL/MX Reference Manual
and JDBC Driver for SQL/MX Programmer's Reference.
java.sql.Timestamp TIMESTAMP Timestamp in form
yyyy-mm-dd
hh:mm:ss.msssss
java.lang.Short (or short) SMALLINT 16-bit signed binary integer
java.lang.Integer (or int) INT[EGER] 32-bit signed binary integer
java.lang.Long (or long) LARGEINT 64-bit signed binary integer
java.math.BigDecimal NUMERIC(p,s) Exact binary number with
precision and scale
java.math.BigDecimal DEC[IMAL](p,s) Packed decimal number with
precision and scale
java.lang.Float (or float) REAL Single-precision floating-
point number
java.lang.Double (or double) DOUBLE PRECISION Double-precision floating-
point number
Table 3-3. Optimal Data Type Mappings (page 2 of 2)
Java Wrapper Class or
Primitive Data Type
*
SQL Data Type SQL Column Description
*
The Java primitive data types, such as boolean, byte, and int, have corresponding Java wrapper classes,
which are part of the java.lang package. Java primitive data types do not support null values. For more
information, see Null Values
on page 3-29.