The informix-direct subprotocol

The Informix® JDBC Driver DriverManager class provides services to connect to Informix JDBC Driver drivers. It assists in loading and initializing a requested driver.

A UDR written in Java™ code uses the registerDriver() method of DriverManager to register itself and to redirect user messages to the DriverManager logging facility.

A UDR written in Java code or a Java client application that wants to connect to the database calls the DriverManager.getConnection() method to obtain a connection handle. This method takes a URL string as an argument. The driver management layer attempts to locate a driver that can connect to the database that the URL represents. To perform this task, the driver management layer asks each driver in turn if it can connect to the specified URL. Each driver examines the URL and determines if it supports the specified subprotocol. The Informix implementation of UDRs written in Java code supports the informix-direct subprotocol in the database server.

For the informix-direct subprotocol, the driver loads and uses the following classes:
  • The connection class, which you can specify with the ConnectionClass property. The connection class must implement IfxConnection.
  • The protocol class, which you can specify with the ProtocolClass property. This protocol class must implement IfxProtocol.

These specifiers are optional in the URL string. If you do not specify ConnectionClass or ProtocolClass, the Informix JDBC Driver can determine them from the subprotocol.

The following call opens a UDR connection with the class IfxDirectConnection. It uses the IfxDirectProtocol as the protocol for processing queries on the current database.
DriverManager.getconnection("jdbc:informix-direct:"+
"//ConnectionClass="com.informix.jdbc.IfxDirectConnection;"+
"//ProtocolClass=com.informix.jdbc.IfxDirectProtocol");

The UDR connection can be opened only by the thread that executes the UDR static method. In this way, the database server can ensure that the proper transaction context is used for the UDR.