informix
Informix JDBC Driver Programmer's Guide
Programming with Informix JDBC Driver

Other Informix Extensions to the JDBC API

This section describes the Informix-specific extensions to the JDBC API not already covered in this guide. These extensions handle information that is specific to Informix databases.

Another Informix extension, the com.informix.jdbc.Message class, is fully described in Handling Errors.

The Auto Free Feature

If you enable the Informix auto free feature, the database server automatically frees the cursor when it closes the cursor. Therefore, your application does not have to send two separate requests to close and then free the cursor-closing the cursor is sufficient.

You can enable the auto free feature by setting the IFX_autofree variable to TRUE in the database URL, as in this example:

You can also use one of the following methods:

The setAutoFree() method should be called before the executeQuery() method, but the getAutoFree() method can be called before or after the executeQuery() method.

To use these methods, your applications must import classes from the Informix package com.informix.jdbc and cast the Statement class to the IfmxStatement class, as shown here:

The Auto Free feature is available for the following database server versions:

Obtaining Driver Version Information

There are two ways to obtain version information about Informix JDBC Driver: from your Java program, or from the UNIX or Windows command line. The command line method also allows you to obtain the serial number you provided when you installed the driver on your computer.

To get version information from your Java program

  1. Import the Informix package com.informix.jdbc.* into your Java program by adding the following line to the import section:
  2. Invoke the static method IfxDriver.getJDBCVersion(). This method returns a String object that contains the complete version of the current Informix JDBC Driver.
  3. An example of a version of Informix JDBC Driver is 2.00.JC1.

    The IfxDriver.getJDBCVersion() method does not return the serial number you provided during installation of the driver.

    Important: For Version X.Y of Informix JDBC Driver, the JDBC API methods Driver.getMajorVersion() and DatabaseMetaData.getDriverMajorVersion() always return the value X. Similarly, the methods Driver.getMinorVersion() and DatabaseMetaData.getDriverMinorVersion() always return the value Y.

To get the version of Informix JDBC Driver from the command line, enter the following command at the UNIX shell prompt or the Windows command prompt:

The command also returns the serial number you provided when you installed the driver. An example of a serial number is INF#J000000.


Informix JDBC Driver Programmer's Guide, Version 2.0
Copyright © 1999, Informix Software, Inc. All rights reserved