Chapter 12. J2EE Connector Architecture scenario 401
setCommarea(comm);
}
public Object clone() throws CloneNotSupportedException{
return super.clone();
}
public void setCommarea(byte[] comm) {
try {
read(new java.io.ByteArrayInputStream(comm));
}catch (java.io.IOException ioe) {
}
}
12.3.2 Data conversion
An enterprise tier might use a different code set from the client application.
Typically the enterprise tier resides in a mainframe using the EBCDIC code set,
and the client application is written in Java using Unicode. Similarly, encoding of
an integer in the PC world is different from that in the UNIX and mainframe
worlds. There are various options to performing data conversion between
different systems.
Data conversion with Rational Software Architect
If you are using Rational Software Architect, the J2EE Connector Tools provide
the tools to do the automatic conversion. Using the tools, you can import the
Java message structure and conversion code from the C or COBOL
COMMAREA definition used in the CICS application. The panel shown in
Figure 12-7 on page 402 allows you to select the required options while creating
a data binding record class.
402 Patterns: Implementing Self-Service in an SOA Environment
Figure 12-7 Data conversion options
Data conversion manually
If you create a record manually using a generic record, you need to perform code
conversion yourself. Example 12-3 on page 403 shows how the String account
name is converted to EBCDIC using the String getBytes method, and then used
to set the input record.

Get Patterns: Implementing Self-Service in an SOA Environment now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.