DB2 Version 9.7 for Linux, UNIX, and Windows

DB2Binder class

The com.ibm.db2.jcc.DB2Binder class provides the runJDBCBinder method as an alternative to the DB2Binder utility for binding IBM® Data Server Driver for JDBC and SQLJ packages.

DB2Binder methods

The following methods are defined only for the IBM Data Server Driver for JDBC and SQLJ.

runJDBCBinder
Format:
public void runJDBCBinder(DB2Connection connection,
  java.util.Properties db2BinderOptions)
  throws SQLException

Binds a IBM Data Server Driver for JDBC and SQLJ package.

Parameters:
connection
A DB2Connection object for a connection that was established at the data server on which the packages are being bound.
db2BinderOptions
A java.util.Properties object that contains key and value pairs, in which each key is the name of a DB2Binder utility option, and each value is the value to which you want to set that DB2Binder option. See DB2Binder utility for a list of DB2Binder options.

For example, suppose that con is a previously defined Connection object. Set the property values in the following way.

DB2Binder db2binder = new DB2Binder();
Properties prop = new Properties();
prop.put ("action", "replace");
prop.put ("bindoptions", "DEFER(PREPARE) IMMEDWRITE(NO) REOPT(NONE)");
db2binder.runJDBCBinder((DB2Connection)con,prop);

This method is not supported for connections to IBM Informix®.