Setting properties locally for individual connections that use the IBM Data Server Driver for JDBC and SQLJ

You can use any of three methods to set these properties for individual connections.

The three methods are:

Adding the pdqProperties string to a URL in a Connection object
For Type 2 URLs, add the pdqProperties string as in this syntax diagram:
Read syntax diagramSkip visual syntax diagram
                                                    .-,--------------------.          
                                                    V                      |    (1)   
>>-jdbc--:--db2--:--subsystem--:--pdqProperties--=----+-key-- -value-----+-+--;-----><
                                                      '-key--(--value--)-'            

Notes:
  1. You can specify other properties for the IBM® Data Server Driver for JDBC and SQLJ besides pdqProperties. Separate each, including its values, with a semicolon. End the list of key-and-value pairs with a semicolon.
For Type 4 URLs, add the pdqProperties string as in this syntax diagram:
Read syntax diagramSkip visual syntax diagram
                                                                                            .-,--------------------.          
                                                                                            V                      |    (1)   
>>-jdbc--:--db2--:--//--server--+---------+--/--database-or-subsystem--:--pdqProperties--=----+-key-- -value-----+-+--;-----><
                                '-:--port-'                                                   '-key--(--value--)-'            

Notes:
  1. You can specify other properties for the IBM Data Server Driver for JDBC and SQLJ besides pdqProperties. Separate each, including its values, with a semicolon.
Setting the properties in a Properties object that you pass to the Connection
When you set the properties in a Properties object, You can set them as in this example:
java.util.Properties myPdqProperties = new java.util.Properties();
myPdqProperties.put("pdqProperties","captureMode,(ON),pureQueryXml(Sample22.xml)");
Setting the properties in a DataSource object
You can set them as in this example:
DB2SimpleDataSource dbsrc = new DB2SimpleDataSource ();
dbsrc.setServerName ("serv1.jke.com");
dbsrc.setDatabaseName ("STLEC1");
dbsrc.setPortNumber (446);
dbsrc.setUser ("sysadm");
dbsrc.setPassword ("passw0rd");
dbsrc.setDriverType (4);
dbsrc.setPdqProperties("captureMode(on),pureQueryXml(Sample22.xml)");
Connection con = dbsrc.getConnection (); 

Feedback