You are on page 1of 18

© Copyright IBM Corp. 2004. All rights reserved. ibm.

com/redbooks 1
Redbooks
Paper
Linux Grid Implementation from DB2 on
z/OS
Abstract
This IBM® Redpaper describes an implementation that routes CPU-intensive parts of an
application from DB2® UDB on z/OS® to a Linux® grid environment and returns the results to
the requesting stored procedure in DB2.
Background and objectives
There are many definitions for data mining. The one given here is detailed, and it lays the
foundation for the rest of this paper:
The function of database applications that probe for hidden or undiscovered patterns in
given collections of data. These applications use pattern recognition technologies as well
as statistical and mathematical techniques and can have a key impact on the return on
investment (ROI) for a technology expenditure upon discovering marketing or customer
service data about one's clients. Data mining is not simple, and most companies have not
yet actively mined their data, though nearly all have plans to do so in the future. From:
http://www.eccs.uk.com/VD25/default.asp?LLID=25&CID=213&PSID=466
When the data to be mined is retained in a relational database, much of the “discovery” work
can be performed based on the indexing of data in the rows. But in some cases, the
interesting data is so large that indexing is not viable. This paper demonstrates how other
high-speed systems can be integrated into the solutions, while the data is retained on z/OS.
Hong Min
Paul Wanish
2 Linux Grid Implementation from DB2 on z/OS
Architecture
Here we show the original architecture and then describe the one used in our example.
Sample architecture
The additional compute resource we chose for this project was Linux on xSeries®; that is, we
planned to move the CPU-bound DB2 stored procedure work from DB2 to a Linux grid
environment, while leaving the rest of the DB2 stored procedure architecture on z/OS. The
request to execute a DB2 stored procedure begins execution, and develops a temporary
result set. Then the rows are forwarded from DB2 to a Linux grid environment, and after
calculation, the results are returned to DB2 on z/OS.
Further, by splitting the DB2 stored procedure processing, it is much easier to enable industry
standard rules engines, such as Fair Isaac Blaze Advisor and ILOG JRules, to be deployed
as Linux applications. These applications already support Linux, and can process individual
requests efficiently. Generally, they return a ranking value, which is similar to that found in
credit card risk assessments. Further, these rules engines, which interpolate many pieces of
data, can be tested before deployment with representative sets of data from the database to
ensure that the ranking and results are as expected, and then integrated into the grid when
necessary.
The original deployment is illustrated in Figure 1. Figure 2 on page 3 shows the architecture
we used in our example.
Figure 1 Original architecture
Linux Grid Implementation from DB2 on z/OS 3
Figure 2 The architecture of our example
DataSynapse architecture
The plumbing software we chose was GridServer from DataSynapse. GridServer is a
distributed computing platform for grid computing. It creates a virtual pool of compute
resources over existing hardware and network infrastructures. Compute-intensive,
data-intensive, or throughput-intensive applications can be distributed over the pool to
achieve increased performance and reliability. Figure 3 on page 4 shows a GridServer
architecture chart from DataSynapse GridServer User Guide [1].
4 Linux Grid Implementation from DB2 on z/OS
Figure 3 GridServer architecture
GridServer incorporates three main grid components: Drivers, Engines, and Managers.
Drivers serve client applications and act as agents for the client application to the GridServer
Managers. Engines are the compute resources that the Manager uses to accomplish work
requested from the grid by client applications. Managers are the controlling mechanism for
the grid, scheduling work, managing states, and monitoring the grid.
The GridServer distributed parallel processing model works as follows:
1. Client applications (via Drivers) submit messages with work requests to a central
Manager.
2. Engines report to the Manager when they are available for work.
3. The Manager assigns an individual unit of work to the Engine.
4. The Engine notifies the Manager when it has completed the unit of work.
5. Drivers poll the Manager for completed work units. Drivers pull work results directly from
the Engines (when direct data transfer mode is on.)
The core GridServer components are implemented in Java™, and the default
inter-component communication protocol is HTTP. Secure Sockets Layer (SSL) can be used
for driver authentication and message protection.
We mapped our example architecture, shown in Figure 2 on page 3, to these three cluster
components. A client piece runs in a stored procedure for DB2 UDB on z/OS, and acts as the
Driver. Multiple instances of analysis programs run on Linux image Engines. GridServer
Manager, which includes a director and multiple brokers, runs on a separate Linux image.
Linux Grid Implementation from DB2 on z/OS 5
DB2 to grid implementation
One of several options available to adapt applications to use GridServer is Java service,
which uses Web Services technology and works well on z/OS.
As shown in Figure 2 on page 3, there are two pieces that need to be implemented: Driver
and Service.
GridServer Service implementation
In the GridServer Service execution model, method calls from the client are routed over the
network, ultimately resulting in method calls on a remote machine, and return values make
the reverse trip. A service can be a command, a dynamic link library (dll or .so), .NET
assembly, or Java class. In the example here, it is a simple Java class that takes input data
from a stored procedure grid client on z/OS, and returns a new calculated value (see
Example A-5 on page 11). The service is registered at GridServer Director as GridProc (see
Figure 4) and the method being called by the client is adjustCost (see Example A-6 on
page 11).
Figure 4 Grid Service registration
Driver implementation
As mentioned earlier, GridServer Driver is the client side agent. In our example the stored
procedure is the client code. The stored procedure method includes two steps: query the DB2
table to retrieve some data, and submit the data to GridServer asynchronously for processing
or analysis. Stored procedure code fragments are shown in Example 1 on page 6; the
complete source code is shown in Example A-6 on page 11.
6 Linux Grid Implementation from DB2 on z/OS
Example 1 Stored procedure code sample
package gridspsample;
...
public class Sample01
public static void select ( --------- (1)
String callingNo1,
String callingNo2,
int[] returnValue)
throws SQLException, Exception
...
//JDBC calls to execute query
url = "jdbc:default:connection"; --------- (2)
Connection con = java.sql.DriverManager.getConnection(url);
Statement stmt = con.createStatement();
query = "SELECT COST FROM HEWORCDB.CALL_DATA " +
"WHERE CALLING_NO >= '" + callingNo1+
"' AND CALLING_NO <='" + callingNo2+"'";
// obtain resultset
ResultSet rs = stmt.executeQuery(query);
...
// Connect to GridServer
// set userID and password for the grid --------- (3)
byte bcl_name[]= {0x72,0x6F,0x6F,0x74,0x64,0x3A};
//ASCII bytes represents "userd:"
String uid=new String(bcl_name,"Cp1047");
byte bcl_pwd[]= {0x70,0x61,0x73,0x73,0x77,0x6F,0x72,0x64};
//ASCII bytes represents "password"
String password =new String(bcl_pwd,"Cp1047");
String svcName = "GridProc"; --------- (4)
int numRequests = 0; // number of request to submit;
ServiceData input = new ServiceData();
ServiceData[] inputs = new ServiceData[1];
// make conneciton to grid
ServiceClient service; --------- (5)
service= PersistentServiceClientFacade.instance(uid,password,
"http://etpserv20.pbm.ihost.com:8000",
"http://etpserv20.pbm.ihost.com:8000").getServiceClient(svcName);
// submit the cost value in each row of resultset to GridServer
while (rs.next()) // process result set and submit to GridServer
{ --------- (6)
int cost = rs.getInt(1);
input.setStr( Integer.toString(cost)) ;
numRequests++;
inputs[0]=input;
service.submit("adjustCost",inputs);
} // end while loop
...
// collect result from grid and accumulate total cost
int totalAdjustedCost = 0;
...
while((collectTimes < collectMax) && (numResults < numRequests))
{ --------- (7)
collectTimes ++;
sessionReply = service.collect();
service.collectAck();
svcReply = sessionReply.getServices();
int svcReplyLen = java.lang.reflect.Array.getLength(svcReply);
for (int kk =0; kk < svcReplyLen; kk++)
{ svcOutput= svcReply[kk].getOutput();
if (svcOutput != null)
Linux Grid Implementation from DB2 on z/OS 7
{
int lenOut =
java.lang.reflect.Array.getLength(svcOutput);
for (int jj=0;jj<lenOut; jj++)
{
totalAdjustedCost = totalAdjustedCost +
Integer.parseInt(svcOutput[jj].getValue().getStr());
numResults ++;
}
} // endif
} // end for
} // end while
returnValue[0] = totalAdjustedCost; --------- (8)
// back from grid
} // try
...
The following points refer to Example 1.
1. The stored procedure method has to be declared as public static void. The parameter
returnValue is declared as integer array, even though in the example it is a single integer.
This is because DB2 passes INOUT and OUT parameters as single-entry arrays, and
those parameters are to be declared as arrays in the Java routine, too.
2. The stored procedure uses JDBC calls to query the DB2 table.
3. User ID and password are required to establish a session with GridServer Manager. Since
the GridServer persistent SOAP driver uses Axis SOAP for communication, basic HTTP
authentication is used for security with an HTTP header in the format:
http://[user:password]@hostname[:port]/
Axis code used by the GridServer persistent SOAP driver takes username and password
as Java String inputs, and concatenates them with a colon (:) in the middle as separation
token. However, this causes a problem when we drive a client from z/OS whose codepage
is EBCDIC. The character : is converted to z (byte 7A) and the URL is sent down to the
GridServer Manager as:
http://[userzpassword]@hostname[:port]/
To work around this problem, we created all the users on the GridServer side with
passwords starting with the character z. From the z/OS Java client side, we used the
ASCII byte code version of the user ID with suffix :, and the password without a leading z,
and converted them to Java String in codepage Cp1047. For example, we set up the user
ID/password pair userd/zpassword at the GridServer side, and sent the persistent SOAP
driver ASCII byte code for userd:/password at the client side. After the codepage
conversions, the GridServer receives the URL:
http://userd:zpassword/
which is defined to GridServer Manager. This username/password approach to get around
codepage problems works with any z/OS Java implementation that makes Axis calls to
platforms with ASCII codepages.
4. The service name matches what is registered with GridServer Manager.
5. Connect to GridServer Manager with a primary URL and a backup URL.
6. Iterate through the result set and submit the data to GridServer asynchronously for
method adjustCost of service GridProc to process.
7. Collect the next available set of output data from service submissions. Stop collecting
when all results have been collected or the maximum number of collection attempts has
been reached.
8 Linux Grid Implementation from DB2 on z/OS
8. Set the return value from the stored procedure to the client.
DB2 stored procedure setup
A DB2 stored procedure on z/OS runs in a Workload Manager (WLM)-managed address
space. In addition to writing the stored procedure Java code, we need to define a
corresponding WLM application environment called SPGRID (see Figure 5) and WLM proc
(see Example A-1 on page 10).
Figure 5 Modifying an application environment
There are two extra DD statements in the WLM proc for the Java stored procedure:
JAVAENV DD, which specifies a data set that contains environment variables that define
system properties for the execution environment.
JSPDEBUG DD, which specifies a data set into which DB2 puts information for debugging
the stored procedure.
Our JAVAENV data set example is also shown in “Sample WLM proc to start a stored
procedure” on page 10. Several environment variables need to be defined in this data set.
Since the data set size is limited to no more than 245 characters excluding blanks, we use the
_CEE_ENVFILE variable, which points to an HFS file (also shown in “Sample WLM proc to
start a stored procedure” on page 10) that contains most of the environment variables,
because this file has no size limitation.
In addition to the proc and WLM setup, the stored procedure has to be defined to DB2. The
DDL we used is shown in Example A-4 on page 11. For detailed instructions on writing the
DDL definition, refer to DB2 for z/OS Stored Procedures: Through the CALL and Beyond [2].
Persistent Reusable JVM (PRJVM) support in a stored procedure
Every Java stored procedure requires a JVM to execute. Multiple running stored procedures
require the same number of JVMs.
PRJVM is a technology that is mostly used in a transaction environment. Multiple JVMs share
the same address space, but each only runs one transaction at a time to ensure transaction
isolation. The set of JVMs in the same address space, which is called JVMSet, shares a
common system heap of system classes and other shareable classes. This significantly
reduces the time needed to start a new JVM in the JVMSet because the majority of system
classes will already be loaded in the system heap. It also reduces the overall memory
footprint for these classes because they are loaded only once per JVMSet and not once per
JVM.
Linux Grid Implementation from DB2 on z/OS 9
Java classes loaded in PRJVM include system classes, trusted middleware classes (TMC),
and application classes. Trusted middleware is trusted by the JVM to manage its own state
across a JVM-Reset by using the Tidy-Up method at the end of each transaction. References
from the middleware class to application classes are nulled out to ensure JVM-Reset does
not fall into Garbage Collection, which is another expensive operation.
In the case of connecting to GridServer, it is costly for GridServer Driver to log in and
establish a session with GridServer Manager. Establishing a new session for each
transaction degrades performance. DataSynapse developed the persistent SOAP driver to
take advantage of the Trusted Middleware Class feature of PRJVM. The Java classes that
hold the connection and session can be put in the Trusted Middleware Class classpath, as
shown in the TMSUFFIX directive of the env.txt file (Example A-3 on page 10). These
sessions are reused between transactions.
Sample client code to call a stored procedure
The sample client code to call a stored procedure is shown in Example A-7 on page 13. We
used the DB2 JCC driver here.
Summary
This Redpaper shows the use of DataSynapse GridServer as example to demonstrate how
DB2 on z/OS can be integrated in a grid environment. This integration not only enhances the
solution with more CPU computation power, but also provides a means of enabling industry
data mining software that only runs on certain platforms in the end-to-end architecture.
Authors
Hong Min is an advisory software engineer at the IBM Design Center for e-business on
demand, Poughkeepsie, USA. She has seven years of experience in e-business technical
support, customer application design, and prototyping. Her current job focuses are
WebSphere®, J2EE applications, and grid computing.
Paul Wanish is a Senior Technical Staff Member with the IBM Design Center for e-business
on demand in Poughkeepsie. He provides leadership to customer IT organizations in solving
key business problems through the use of IBM products, such as WebSphere, Linux, and
eServer™ technologies. Paul joined IBM in 1970 with a BS in Computer Science, and holds
several patents and many invention disclosures.
References
1. DataSynapse GridServer User Guide, V3.2
2. DB2 for z/OS Stored Procedures: Through the CALL and Beyond, SG24-7083
3. New IBM Technology Featuring Persistent Reusable Java Virtual Machines, SC34-6034
Web sites
IBM Design Center for e-business on demand™:
http://www.ibm.com/servers/eserver/design_center/
10 Linux Grid Implementation from DB2 on z/OS
Appendix A
Appendix A. Sample source code and
configurations
Sample WLM proc to start a stored procedure
Example: A-1 WLM proc
//*************************************************************
//* JCL FOR RUNNING THE WLM-ESTABLISHED STORED PROCEDURES
//* ADDRESS SPACE
//* RGN -- THE MVS REGION SIZE FOR THE ADDRESS SPACE.
//* DB2SSN -- THE DB2 SUBSYSTEM NAME.
//* NUMTCB -- THE NUMBER OF TCBS USED TO PROCESS
//* END USER REQUESTS.
//* APPLENV -- THE MVS WLM APPLICATION ENVIRONMENT
//* SUPPORTED BY THIS JCL PROCEDURE.
//*
//*************************************************************
//DBV3GRID PROC RGN=0K,APPLENV=SPGRID,DB2SSN=DBV3,NUMTCB=1
//IEFPROC EXEC PGM=DSNX9WLM,REGION=&RGN,TIME=NOLIMIT,
// PARM='&DB2SSN,&NUMTCB,&APPLENV'
//STEPLIB DD DISP=SHR,DSN=DBVG.RUNLIB.LOAD
// DD DISP=SHR,DSN=CEE.SCEERUN
// DD DISP=SHR,DSN=DBV.SDSNEXIT
// DD DISP=SHR,DSN=DBV.SDSNLOAD
// DD DISP=SHR,DSN=DBV.SDSNLOD2
//JAVAENV DD DISP=SHR,DSN=ETP.SPGRIDEN
//JSPDEBUG DD SYSOUT=*
//DSSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//JAVAOUT DD PATH='/tmp/sp.grid.out',
// PATHOPTS=(ORDWR,OCREAT,OAPPEND),
// PATHMODE=(SIRUSR,SIWUSR,SIRGRP,SIWGRP,SIROTH,SIWOTH)
//JAVAERR DD PATH='/tmp/sp.grid.err',
// PATHOPTS=(ORDWR,OCREAT,OAPPEND),
// PATHMODE=(SIRUSR,SIWUSR,SIRGRP,SIWGRP,SIROTH,SIWOTH)
Example: A-2 ETP.SPGRIDEN file
ENVAR("_CEE_ENVFILE=/test/db2grid/env.txt",
"JAVA_HOME=/usr/lpp/java/IBM/J1.3"),
MSGFILE(JSPDEBUG,,,,ENQ)
Example: A-3 env.txt
DB2_HOME=/usr/lpp/db2/db2710
CLASSPATH=/test/db2grid
TMSUFFIX=/test/TMC/persistentserviceclient.jar:\
Appendix A. Sample source code and configurations 11
/test/TMC/axis.jar:/csfb/TMC/saaj.jar:\
/test/TMC/commons-discovery.jar:\
/test/TMC/commons-logging.jar:\
/test/TMC/jaxrpc.jar:\
/test/TMC/log4j-1.2.4.jar:\
/test/TMC/DSDriver.jar
Example DDL to create a stored procedure
Example: A-4 DDL example to create the stored procedure
CREATE PROCEDURE DB2ETP.GRIDSP01
(IN CHAR(10),
IN CHAR(10),
OUT INTEGER)
FENCED
COLLID DSNJDBC
LANGUAGE JAVA
EXTERNAL NAME 'gridspsample.Sample01.select2'
WLM ENVIRONMENT SPGRID
PROGRAM TYPE SUB
PARAMETER STYLE JAVA;
COMMIT ;
GRANT EXECUTE ON PROCEDURE
DB2ETP.GRIDSP01
TO PUBLIC ;
COMMIT ;
Grid code
Example: A-5 GridProc.java
import java.lang.*;
public class GridProc
public String adjustCost(String str)
{
int i = -1;
try {
i = Integer.parseInt(str);
Thread.sleep(i);
}
catch (Exception e)
{ return "-1";
}
return Integer.toString(i*2);
}
Sample stored procedure code
Example: A-6 Gridspsample.Sample01
package gridspsample;
import java.sql.*;
import java.math.*;
import java.io.*;
import java.util.*;
import java.lang.*;
12 Linux Grid Implementation from DB2 on z/OS
import com.datasynapse.gridserver.persistence.client.*;
public class Sample01
public static void select2 (
String callingNo1,
String callingNo2,
int[] returnValue)
throws SQLException, Exception
{
String url = null;
String query = null, query1 = null, query2 = null;
try
{
//JDBC calls to execute query
url = "jdbc:default:connection";
Connection con = java.sql.DriverManager.getConnection(url);
System.out.println("
Statement stmt = con.createStatement();
query = "SELECT COST FROM HEWORCDB.CALL_DATA " +
"WHERE CALLING_NO >= '" + callingNo1+
"' AND CALLING_NO <='" + callingNo2+"'";
// obtain resultset
ResultSet rs ;
rs = stmt.executeQuery(query);
// Connect to GridServer
// set userID and password for the grid
byte bcl_name[]= {0x72,0x6F,0x6F,0x74,0x64,0x3A};
//ascii bytes representation "userd:"
String uid=new String(bcl_name,"Cp1047");
byte bcl_pwd[]= {0x70,0x61,0x73,0x73,0x77,0x6F,0x72,0x64};
//ascii bytes representation "password"
String password =new String(bcl_pwd,"Cp1047");
String svcName = "GridProc";
int numRequests = 0; // number of request to submit;
ServiceData input = new ServiceData();
ServiceData[] inputs = new ServiceData[1];
// make conneciton to grid
ServiceClient service;
service= PersistentServiceClientFacade.instance(uid,password,
"http://etpserv20.pbm.ihost.com:8000",
"http://etpserv20.pbm.ihost.com:8000").getServiceClient(svcName);
while (rs.next()) // process result set submit to GridServer
{
int cost = rs.getInt(1);
input.setStr( Integer.toString(cost)) ;
numRequests++;
inputs[0]=input;
service.submit("adjustCost",inputs);
} // end while loop
if (rs != null) rs.close();
if (stmt != null) stmt.close();
// collect result from grid and accumulate total cost
int totalAdjustedCost = 0;
int numResults = 0, collectTimes = 0, collectMax=200;
SessionCollectReply sessionReply = null;
ServiceCollectReply[] svcReply = new
ServiceCollectReply[numRequests];
ServiceOutput[] svcOutput ;
while((collectTimes < collectMax) && (numResults < numRequests))
{
Appendix A. Sample source code and configurations 13
collectTimes ++;
sessionReply = service.collect();
service.collectAck();
svcReply = sessionReply.getServices();
int svcReplyLen = java.lang.reflect.Array.getLength(svcReply);
for (int kk =0; kk < svcReplyLen; kk++)
{ svcOutput= svcReply[kk].getOutput();
if (svcOutput != null)
{
int lenOut =
java.lang.reflect.Array.getLength(svcOutput);
for (int jj=0;jj<lenOut; jj++)
{
totalAdjustedCost = totalAdjustedCost +
Integer.parseInt(svcOutput[jj].getValue().getStr());
numResults ++;
}
} // endif
} // end for
} // end while
returnValue[0] = totalAdjustedCost;
// back from grid
} // try
catch (SQLException e)
{
System.out.println("
e.getErrorCode());
System.out.println("SQLCODE returned: " + e.getErrorCode());
throw(e);
}
catch (Exception e1)
{ System.out.println("Exception: ");
e1.printStackTrace();
}
} // end select
}// end
Sample client code to call a stored procedure
Example: A-7 DbSpClient.java
import java.lang.*;
import java.sql.*;
import java.math.BigDecimal;
import com.ibm.db2.jcc.DB2Diagnosable;
import com.ibm.db2.jcc.DB2Sqlca;
class DbSPclient
public static void main(String argv[])
{
String alias = "DBVG";
String server = "p23.pbm.ihost.com";
int portNumber = 446;
String userId = "db2user";
String password = "hm234yy";
Connection con = null;
CallableStatement cstmt = null;
ResultSet rs = null;
int count =0;
14 Linux Grid Implementation from DB2 on z/OS
String s = null;
try{
String callingNo1 = "8454351000";
String callingNo2 = "8454352000";
String url = "jdbc:db2://"+server+":" + portNumber + "/" + alias;
Class.forName("com.ibm.db2.jcc.DB2Driver").newInstance();
con = DriverManager.getConnection( url, userId, password );
con.setAutoCommit(false);
cstmt = con.prepareCall("CALL DB2ETP.GRIDSP01(?,?,?)");
// Create a CallableStatement object
cstmt.setString (1, callingNo1); // set input parameter
cstmt.setString (2, callingNo2); // set input parameter
int result =10; // result is integer
cstmt.registerOutParameter(3,Types.INTEGER);
cstmt.execute();
result = cstmt.getInt(3);
System.out.println("finished, totalcost= "+result);
if (cstmt != null) cstmt.close();
} // end try
catch (SQLException e)
{
e.printStackTrace();
System.out.println ("SQLException: " + e + ". SQLSTATE=" +
e.getSQLState() + " SQLCODE=" + e.getErrorCode());
System.out.println(e.toString());
processDB2Diagnosable(e);
System.out.println("now roll back ...");
try{
con.rollback();
}
catch (Exception e1)
{ e1.printStackTrace();
}
} // end catch
catch (Exception e2)
{
e2.printStackTrace();
} // catch
} // main
public static void processDB2Diagnosable (java.sql.SQLException sqle) {
// first check whether SQLException object has
// DB2-proprietary diagnostics
if ( sqle instanceof DB2Diagnosable ) {
// A DB2Diagnosable has the method "getSqlca()"
DB2Sqlca sqlca = ((DB2Diagnosable)sqle).getSqlca();
// for future portability, confirm that DB2Sqlca is non-null
if ( sqlca != null ) {
// retrieve Java encapsulation of DB2 SQLCA information
// SQLCODE of DB2 SQLCA
int sqlCode = sqlca.getSqlCode();
// SQLERRMC of DB2 SQLCA
// SQLERRML is implicit via String length() method;
// one String of tokens, ";" used as separator vs. 0xFF
String sqlErrmc = sqlca.getSqlErrmc();
// Convenience method which tokenizes SQLERRMC
// each token is represented as a separate String in an array
String[] sqlErrmcTokens = sqlca.getSqlErrmcTokens();
// SQLERRP of DB2 SQLCA
String sqlErrp = sqlca.getSqlErrp();
// SQLERRD 1..6 of DB2 SQLCA
Appendix A. Sample source code and configurations 15
int[] sqlErrd = sqlca.getSqlErrd();
// SQLWARN 0..A of DB2 SQLCA
char[] sqlWarn = sqlca.getSqlWarn();
// SQLSTATE of DB2 SQLCA
String sqlState = sqlca.getSqlState();
System.out.println ( "-----------DB2Sqlca -------------" );
System.out.println ( "SQLCODE: " + sqlCode );
System.out.println ( "SQLERRMC: " + sqlErrmc );
for ( int i=0; i<sqlErrmcTokens.length; i++ ) {
System.out.println (" token " + i + ":"+ sqlErrmcTokens[i]);
} //end for
System.out.println ( "SQLERRP: " + sqlErrp );
System.out.println (
"SQLERRD(1): " + sqlErrd[0] + "
"SQLERRD(2): " + sqlErrd[1] + "
"SQLERRD(3): " + sqlErrd[2] + "
"SQLERRD(4): " + sqlErrd[3] + "
"SQLERRD(5): " + sqlErrd[4] + "
"SQLERRD(6): " + sqlErrd[5] );
System.out.println (
"SQLWARN1: " + sqlWarn[0] + "
"SQLWARN2: " + sqlWarn[1] + "
"SQLWARN3: " + sqlWarn[2] + "
"SQLWARN4: " + sqlWarn[3] + "
"SQLWARN5: " + sqlWarn[4] + "
"SQLWARN6: " + sqlWarn[5] + "
"SQLWARN7: " + sqlWarn[6] + "
"SQLWARN8: " + sqlWarn[7] + "
"SQLWARN9: " + sqlWarn[8] + "
"SQLWARNA: " + sqlWarn[9] );
System.out.println ( "SQLSTATE: " + sqlState );
} //if
} //if
} // processDB2Diagnosable
} // DbSPclient
16 Linux Grid Implementation from DB2 on z/OS
© Copyright IBM Corp. 2004. All rights reserved. 17
Notices
This information was developed for products and services offered in the U.S.A.
IBM may not offer the products, services, or features discussed in this document in other countries. Consult
your local IBM representative for information on the products and services currently available in your area.
Any reference to an IBM product, program, or service is not intended to state or imply that only that IBM
product, program, or service may be used. Any functionally equivalent product, program, or service that does
not infringe any IBM intellectual property right may be used instead. However, it is the user's responsibility to
evaluate and verify the operation of any non-IBM product, program, or service.
IBM may have patents or pending patent applications covering subject matter described in this document. The
furnishing of this document does not give you any license to these patents. You can send license inquiries, in
writing, to:
IBM Director of Licensing, IBM Corporation, North Castle Drive Armonk, NY 10504-1785 U.S.A.
The following paragraph does not apply to the United Kingdom or any other country where such
provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION
PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR
IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT,
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of
express or implied warranties in certain transactions, therefore, this statement may not apply to you.
This information could include technical inaccuracies or typographical errors. Changes are periodically made
to the information herein; these changes will be incorporated in new editions of the publication. IBM may make
improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time
without notice.
Any references in this information to non-IBM Web sites are provided for convenience only and do not in any
manner serve as an endorsement of those Web sites. The materials at those Web sites are not part of the
materials for this IBM product and use of those Web sites is at your own risk.
IBM may use or distribute any of the information you supply in any way it believes appropriate without
incurring any obligation to you.
Information concerning non-IBM products was obtained from the suppliers of those products, their published
announcements or other publicly available sources. IBM has not tested those products and cannot confirm the
accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the
capabilities of non-IBM products should be addressed to the suppliers of those products.
This information contains examples of data and reports used in daily business operations. To illustrate them
as completely as possible, the examples include the names of individuals, companies, brands, and products.
All of these names are fictitious and any similarity to the names and addresses used by an actual business
enterprise is entirely coincidental.
COPYRIGHT LICENSE:
This information contains sample application programs in source language, which illustrates programming
techniques on various operating platforms. You may copy, modify, and distribute these sample programs in
any form without payment to IBM, for the purposes of developing, using, marketing or distributing application
programs conforming to the application programming interface for the operating platform for which the sample
programs are written. These examples have not been thoroughly tested under all conditions. IBM, therefore,
cannot guarantee or imply reliability, serviceability, or function of these programs. You may copy, modify, and
distribute these sample programs in any form without payment to IBM for the purposes of developing, using,
marketing, or distributing application programs conforming to IBM's application programming interfaces.
18 Linux Grid Implementation from DB2 on z/OS
Send us your comments in one of the following ways:
Use the online Contact us review redbook form found at:
ibm.com/redbooks
Send your comments in an email to:
redbook@us.ibm.com
Mail your comments to:
IBM Corporation, International Technical Support Organization
Dept. HYJ Mail Station P099
2455 South Road
Poughkeepsie, NY 12601-5400 U.S.A.
Trademarks
The following terms are trademarks of the International Business Machines Corporation in the United States,
other countries, or both:
DB2®
e-business on demand™
eServer™
IBM®
Redbooks (logo) ™
WebSphere®
xSeries®
z/OS®
The following terms are trademarks of other companies:
Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun
Microsystems, Inc. in the United States, other countries, or both.
Linux is a trademark of Linus Torvalds in the United States, other countries, or both.
Other company, product, and service names may be trademarks or service marks of others.
®