The com.ibm.db2.jcc.DB2DataSource class extends the DB2BaseDataSource class, and implements the javax.sql.DataSource, java.io.Serializable, and javax.naming.Referenceable interfaces.
The following methods are defined only for the IBM® Data Server Driver for JDBC and SQLJ.
public void setSpecialRegisters(java.util.Properties properties)
throws java.sql.SQLException
For each key and value pair in the java.util.Properties object, sets the data server special register that is specified by the key to the corresponding value.
This method does not apply to connections to IBM Informix® data servers.
Parameter description:
Properties prop = new Properties();
prop.put ("CURRENT SCHEMA", "SYSPROC");
prop.put ("CURRENT PACKAGESET", "PRODUCTION");
((com.ibm.db2.jcc.DB2BaseDataSource) ds).setSpecialRegisters(prop);
Certain special registers can be set through IBM Data Server Driver for JDBC and SQLJ properties. If you set a special register value by setting one of those properties in a java.util.Properties object, and then use setSpecialRegisters to set a value for the same special register, the value that is set through setSpecialRegisters overrides the value that is set through the property. In the following example, CURRENT SCHEMA is set to USER002:
Properties prop = new Properties();
((com.ibm.db2.jcc.DB2BaseDataSource) ds).setCurrentSchema("USER001");
properties. put ("CURRENT SCHEMA", "USER002");
((com.ibm.db2.jcc.DB2BaseDataSource) ds).setSpecialRegisters(prop);
For a complete description of the rules for using setSpecialRegisters to set special registers on DB2® for z/OS® data servers, see General rules for special registers (DB2 SQL).
public void setGlobalSessionVariables(java.util.Properties properties)
throws java.sql.SQLException
For each key and value pair in the java.util.Properties object, sets the session variable that is specified by the key to the corresponding value.
This method applies only to connections to DB2 for z/OS Version 11 or later data servers.
Parameter description:
Properties prop = new Properties();
prop.put ("SESSION.TEST", "TEST FAILED");
prop.put ("SYSIBMADM.GET_ARCHIVE", "Y");
((com.ibm.db2.jcc.DB2BaseDataSource) ds).setGlobalSessionVariables(prop);