Storing and extracting data
- Last Updated: January 17, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
Storing and extracting data
When writing data to a message, an application uses
the name of the data type to specify the Java data type in the message;
the ABL name is identical to the Java name. For example, Java uses
the writeShort procedure to write a number
to a StreamMessage as short.
The ABL counterpart is the internal procedure writeShort(INTEGER).
In the context of extracting data from a message, there is an important difference between the ABL model and the Java model with respect to the names of the methods:
- In Java, the name of the method determines the data type
to which the extracted data is converted. For example, readLongString function extracts a value (for example, an
INTEGERvalue from aStreamMessage) and converts it to aStringvalue. - In ABL, the equivalent function is the readChar function to
convert a value (such as an
INTEGERvalue) to an ABLCHARACTERvalue.
The following table maps the ABL data types to the JMS data types for data storage.
| ABL data type | JMS data type |
|---|---|
| LOGICAL | boolean |
| INTEGER | byte |
| INTEGER | short |
| INTEGER | int |
| INT64 | long |
| DECIMAL | long |
| DECIMAL | float |
| DECIMAL | double |
| CHARACTER | String |
| LONGCHAR | String |
| A single CHARACTER | char |
| RAW | byte array |
| MEMPTR | byte array (only with BytesMessage) |
| DATE | String |
| DATETIME | String |
| DATETIME-TZ | String |
The following table maps the available conversions from JMS data types to ABL data types for data extraction.
| JMS data type | ABL data type |
|---|---|
| boolean | LOGICAL or CHARACTER |
| byte | INTEGER, DECIMAL, or CHARACTER |
| short | INTEGER, DECIMAL, or CHARACTER |
| int | INTEGER, DECIMAL, or CHARACTER |
| long | INT64, DECIMAL or CHARACTER |
| float | DECIMAL or CHARACTER |
| double | DECIMAL or CHARACTER |
| String | CHARACTER or LONGCHAR |
| char | CHARACTER |
| byte array | RAW or MEMPTR (MEMPTR is available only with BytesMessage) |
| Java date string | DATE, DATETIME, or DATE-TZ |