Structured Query Language in Java (SQLJ) is a set of programming extensions that enable a programmer, using the Java programming language, to embed statements that provide Structured Query Language (SQL) database requests. You can use the DB2® for z/OS® Legacy driver with your data access applications.
Following are the steps required to develop applications with SQLJ that run on WebSphere Application Server for z/OS v6.0 using the DB2 for z/OS Legacy driver.
sqlj -compile=false SQLJ_FILE_NAME
Use the data source you created in Step 1 to resolve your resource references.
db2profc -pgmname=PROGRAM_NAME PROFILE_NAME
Space units=TRACK Primary quantity=15 Secondary quantity=5 Directory blocks=10 Record format=FB Record length=80 Block size=27920 Data set name type=PDS
The output of the DB2 profile customizer and the input file have the same name. Move the output file ahead of the original serialized profile in the classpath. Alternatively, you can move the customized profile into the EJB JAR file, replacing the original. It is recommended that you replace the original file.
IMPORTANT: If you run the db2profc command from the directory where the serialized profile exists, the profile customizer overwrites the serialized profile. Because you need only the customized version after the profile customizer has run, this is not a problem.
The db2profc customization command creates a series of DBRMs that must be bound into packages. For each customized profile, four DBRMs are created.
For example, if you log in as IBMUSER, and you specify -pgmname=TESTBMP, then run the db2profc command, the four data sets, TESTBMP1, TESTBMP2, TESTBMP3, AND TESTBMP4 are created and placed in the PDS IBMUSER.DBRMLIB.DATA.
These data sets must be bound into packages with isolation of UR, CS, RS, and RR. You must run a bind for each serialized profile that you customize.
IMPORTANT: You must also include the JDBC packages in the package list (PKLIST) of your new plan. The default names for the JDBC packages to include are DSNJDBC.DSNJDBC1, ..., DSNJDBC.DSNJDBC4. If your installation did not use the default names for the JDBC packages, contact your DB2 administrator to determine the names of the JDBC packages that you need to include.
//BBOOLS JOB (516B,1025),'IBMUSER',MSGCLASS=H,CLASS=A,PRTY=14, // NOTIFY=&SYSUID,TIME=1440,USER=IBMUSER,PASSWORD=IBMUSER, // MSGLEVEL=(1,1) //******************************************************************** //BINDOLS EXEC PGM=IKJEFT01,DYNAMNBR=20 //DBRMLIB DD DSN=IBMUSER.DBRMLIB.DATA,DISP=SHR //* DD DSN=MVSDSOM.DB2710.SDSNDBRM,DISP=SHR //SYSTSPRT DD SYSOUT=* //SYSPRINT DD SYSOUT=* //SYSUDUMP DD SYSOUT=* //SYSTSIN DD * DSN SYSTEM(DB2) BIND - PACKAGE(TESTBMP) - QUALIFIER(IBMUSER) - MEMBER(TESTBMP1) - VALIDATE(BIND) - ISOLATION(UR) - SQLERROR(NOPACKAGE) - BIND - PACKAGE(TESTBMP) - QUALIFIER(IBMUSER) - MEMBER(TESTBMP2) - VALIDATE(BIND) - ISOLATION(CS) - SQLERROR(NOPACKAGE) - BIND - PACKAGE(TESTBMP) - QUALIFIER(IBMUSER) - MEMBER(TESTBMP3) - VALIDATE(BIND) - ISOLATION(RS) - SQLERROR(NOPACKAGE) - BIND - PACKAGE(TESTBMP) - QUALIFIER(IBMUSER) - MEMBER(TESTBMP4) - VALIDATE(BIND) - ISOLATION(RR) - SQLERROR(NOPACKAGE) - BIND PLAN(SQLJPLAN) - QUALIFIER(IBMUSER) - PKLIST(TESTBMP.* - DSNJDBC.* ) - ACTION(REPLACE) RETAIN® - VALIDATE(BIND) END /*
GRANT EXECUTE ON PLAN PLANNAME TO APPSERVERIDWhere:
In this information ...Related tasks
| IBM Redbooks, demos, education, and more(Index) Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience. This feature requires Internet access. Most of the following links will take you to information that is not part of the formal product documentation and is provided "as is." Some of these links go to non-IBM Web sites and are provided for your convenience only and do not in any manner serve as an endorsement by IBM of those Web sites, the material thereon, or the owner thereof. |