Methods for retrieving and converting data types
With the IMS Universal JDBC driver, you can use the ResultSet interface (java.sql.ResultSet) to retrieve and convert the data from the type that is defined in the database metadata to the type that is required by your Java™ application. Similarly, with the IMS Universal DL/I driver, you can use the Path interface to perform data retrieval and conversion to Java data types.
The following table shows the available get methods in the ResultSet interface (for the IMS Universal JDBC driver) or the Path interface (for the IMS Universal DL/I driver) for accessing data of a certain Java data type.
The "No Truncation or Data Loss" column indicates the data types that are designed to be
accessed with the given getXXX method. No truncation or data loss occurs when using those methods
for those data types. The data types that are in the Legal without Data Integrity
column are
all other legal calls; however, data integrity cannot be ensured when using the given getxxx method
to access those data types. If a data type is not in either column, using the given getXXX method
for that data type will result in an exception.
ResultSet.getXXX Method or Path.getXXX Method | Data Type (any not listed result in an exception) | |
---|---|---|
No Truncation or Data Loss | Legal without Data Integrity | |
getByte | TINYINT |
SMALLINT |
getShort | SMALLINT |
TINYINT |
getInt | INTEGER |
TINYINT |
getLong | BIGINT |
TINYINT |
getFloat | FLOAT | TINYINT |
getDouble | DOUBLE | TINYINT |
getBoolean | BIT | TINYINT |
getString | CHAR |
TINYINT |
getBigDecimal | BINARY3 |
TINYINT |
getClob | CLOB2 | all others result in an exception |
getBytes | BINARY |
SMALLINT TIMESTAMP |
getDate | DATE | CHAR |
getTime | TIME | CHAR |
getTimestamp | TIMESTAMP | CHAR |
- PACKEDDECIMAL and ZONEDDECIMAL are data type extensions for IMS Universal JDBC driver and the IMS Universal DL/I driver. All other types are standard SQL types defined in SQL92. Restriction: PACKEDDECIMAL and ZONEDDECIMAL data types do not support the Sign Leading or Sign Separate modes. For these two data types, sign information is always stored with the Sign Trailing method.
- The CLOB data type is supported only for the retrieval and storage of XML data.
- The BINARY data type is valid only for decimal data used with a binary type converter.
If the field type is either PACKEDDECIMAL or ZONEDDECIMAL, the type
qualifier is the COBOL PICTURE string that represents the layout of the field. All COBOL PICTURE
strings that contain valid combinations of 9s, Ps, Vs, and Ss are supported. Expansion of PICTURE
strings is handled automatically. For example, '9(5)' is a valid PICTURE string. For zoned decimal
numbers, the decimal point can also be used in the PICTURE string. PIC 9(06)V99
COMP
and PIC 9(06)V99 COMP-4
are valid PICTURE clauses for BINARY decimal
data.
11122015 is December 11, 2015
For DATE and TIME types, all formatting options in the java.text.SimpleDateFormat class are supported.
yyyy-mm-dd hh:mm:ss.fffffffff