Setting the Db2 for z/OS application compatibility for your JDBC and SQLJ applications
You can set the Db2 for z/OS application compatibility for Java applications by specifying a bind option for static applications, or a special register for dynamic applications.
About this task
In Db2 for z/OS, you can specify whether you want applications to run by using the features and behavior of the current Db2 for z/OS version or of a previous Db2 for z/OS version.
Procedure
To set the application compatibility for Java applications, follow one of these procedures.
Examples
Example: In a JDBC application that uses the DriverManager interface, set the application compatibility to V11R1 in the connection URL.
String url =
"jdbc:db2://sysmvs1.svl.ibm.com:5021/STLEC1" +
":user=dbadm;password=dbadm;" +
"specialRegisters=CURRENT APPLICATION COMPATIBILITY='V11R1'" + ";";
Connection con =
java.sql.DriverManager.getConnection(url);
Example: In a JDBC application that uses the DataSource interface, set the application compatibility to V10R1 using the setSpecialRegisters method.
DB2DataSource ds = new DB2DataSource();
…
Properties prop = new Properties();
prop.add("CURRENT APPLICATION COMPATIBILITY","V10R1");
…
ds.setSpecialRegisters(prop);
Example: Customize and bind the package for serialized profile EzSqlj_SJProfile0.ser so that the application is compatible with Db2 for z/OS Version 10.
db2sqljcustomize -user myid -password mypw
-url jdbc:db2://sysmvs1.stl.ibm.com:5021/STLEC1
-bindoptions "APPLCOMPAT(V10R1)" EzSqlj_SJProfile0.ser
Example: Rebind packages EZSQLJ01, EZSQLJ02, EZSQLJ03, and EXSQLJ04 for serialized profile EzSqlj_SJProfile0.ser so that the application is compatible with Db2 for z/OS Version 11.
java com.ibm.db2.jcc.DB2Binder
-url jdbc:db2://sysmvs1.stl.ibm.com:5021/STLEC1 -user myid -password mypw
-bindoptions "APPLCOMPAT V11R1" -generic -action rebind -collection mycoll
-package EZSQLJ01
java com.ibm.db2.jcc.DB2Binder
-url jdbc:db2://sysmvs1.stl.ibm.com:5021/STLEC1 -user myid -password mypw
-bindoptions "APPLCOMPAT V11R1" -generic -action rebind -collection mycoll
-package EZSQLJ02
java com.ibm.db2.jcc.DB2Binder
-url jdbc:db2://sysmvs1.stl.ibm.com:5021/STLEC1 -user myid -password mypw
-bindoptions "APPLCOMPAT V11R1" -generic -action rebind -collection mycoll
-package EZSQLJ03
java com.ibm.db2.jcc.DB2Binder
-url jdbc:db2://sysmvs1.stl.ibm.com:5021/STLEC1 -user myid -password mypw
-bindoptions "APPLCOMPAT V11R1" -generic -action rebind -collection mycoll
-package EZSQLJ04