Home | Previous Page | Next Page   The IBM Informix JDBC Driver >

The informix-direct Subprotocol

The JDBC DriverManager class provides services to connect to JDBC drivers. It assists in loading and initializing a requested JDBC 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 JDBC management layer attempts to locate a driver that can connect to the database that the URL represents. To perform this task, the JDBC 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 JDBC 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 JDBC driver loads and uses the following classes:

These specifiers are optional in the URL string. If you do not specify ConnectionClass or ProtocolClass, the IBM 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 only be opened 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.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]