BIGINT and BIGSERIAL data types

The BIGINT and BIGSERIAL data types have the same range of values as INT8 and SERIAL8 data types. However, BIGINT and BIGSERIAL have advantages for storage and computation over INT8 and SERIAL8.

Both the BIGINT and BIGSERIAL data types map to the to BIGINT Java™ type in the class java.sql.Types. When data is retrieved from the database, the BIGINT and BIGSERIAL data types map to long Java Type.

The OneDB® JDBC Driver provides support for the HCL OneDB BIGSERIAL and BIGINT data types through the getBigSerial() method, which is a part of the java.sql.Statement interface

Because the BIGSERIAL and BIGINT data types do not have an obvious mapping to any JDBC API data types from the java.sql.Types class, you must import classes that are specific to HCL OneDB into your Java program to handle BIGSERIAL and BIGINT columns. To do this, add the following import line to your Java program:
import com.informix.jdbc.*;

Use the getBigSerial() method after an INSERT statement to return the value that was inserted into the BIGSERIAL or BIGINT column of a table.

If you want to use the getBigSerial() method, you must cast the Statement or PreparedStatement object to IfmxStatement, the implementation of the Statement interface, which is specific to HCL OneDB. The following example shows how to perform the cast:
cmd = "insert into bigserialTable(i) values (100)";
stmt.executeUpdate(cmd);
System.out.println(cmd+"...okay");
long serialValue = ((IfmxStatement)stmt).getBigSerial();
System.out.println("serial value: " + serialValue);

These types are part of the com.informix.lang.IfxTypes class. See the The IfxTypes class table for the IfxTypes constants and the corresponding HCL OneDB data types.