![]() |
|
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.
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:
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.
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.