19.06.2013 Views

DB2 UDB for z/OS Version 8 Performance Topics - IBM Redbooks

DB2 UDB for z/OS Version 8 Performance Topics - IBM Redbooks

DB2 UDB for z/OS Version 8 Performance Topics - IBM Redbooks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Still, this second conversion is a conversion from 1208 to 1200 which is somewhat less<br />

expensive than an ASCII conversion (provided that z/<strong>OS</strong> 1.4 is installed).<br />

In summary, <strong>for</strong> CHAR columns, not setting DISABLEUNICODE shifts the Unicode<br />

conversion during the Insert from the z/<strong>OS</strong> server to the workstation client, helping to reduce<br />

class 2 CPU time. For GRAPHIC columns, DISABLEUNICODE has a more subtle effect,<br />

because in one case the class 2 CPU time contains a conversion from UTF-8 to UTF-16, and<br />

in the other case the class 2 CPU time contains a conversion from ASCII to UTF-16 (a Java<br />

application would send all data as UTF-8.)<br />

The same DISABLEUNICODE parameter affects both host variables and SQL statements.<br />

Since <strong>DB2</strong> V8 does SQL parsing in Unicode, it becomes more important to avoid setting<br />

DISABLEUNICODE. This is especially true if any of the code points used in the SQL<br />

statement is greater than 127. If all code points are less than 128, CCSID 1208 is equivalent<br />

to ASCII, and no conversion of the SQL statement actually occurs. See “<strong>DB2</strong> V8 major and<br />

minor conversion” on page 185 <strong>for</strong> more details.<br />

Now let us have a look at Unicode conversion <strong>for</strong> Java clients.<br />

Along with <strong>DB2</strong> V8, <strong>IBM</strong> introduced the Universal Driver <strong>for</strong> JDBC and SQLJ to replace the<br />

old Legacy JDBC Driver. The Universal Driver does not use <strong>DB2</strong> Connect. The Universal<br />

Driver supports both a Type 2 and Type 4 Driver. While the Type 2 Driver is optimally used by<br />

local Java applications running on z/<strong>OS</strong>, the Type 4 Driver can be used by workstation clients<br />

as well as z/<strong>OS</strong> clients. The Type 4 Driver uses DRDA protocols.<br />

Since the Universal Driver does not use <strong>DB2</strong> Connect, the DISABLEUNICODE parameter is<br />

not applicable. Instead the Universal Type 4 Driver supports a new “UseServerEncoding” data<br />

source property. Unlike the Legacy Driver, the Universal Driver always sends the SQL<br />

statement in UTF-8 no matter how the property is set. The Universal Java Driver is shipped<br />

with <strong>DB2</strong> V8 and V7 with PQ8841. Although it can connect to <strong>DB2</strong> V7, it is optimized to work<br />

with <strong>DB2</strong> V8. Since the Universal Driver always sends the SQL statement in UTF-8, a V7<br />

server has to convert the SQL statement to EBCDIC, and the result is higher class 2 CPU<br />

time.<br />

Because there is no disadvantage to using UseServerEncoding=1, our discussion assumes<br />

that UseServerEncoding=1 is always used.<br />

Figure 4-15 shows the Universal Java Type 2 Driver locally connecting to <strong>DB2</strong> V8, first using<br />

an EBCDIC database and then using a Unicode database.<br />

Chapter 4. <strong>DB2</strong> subsystem per<strong>for</strong>mance 179

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!