Driver restrictions and limitations
- With ,
Version 9.2, the driver always returns a -9752 error if a function
contains an OUT parameter. The driver creates an SQLWarning object
and chains this to the CallableStatement object.
You can determine if a function contains an OUT parameter by calling the CallableStatement.getWarnings() method or by calling the IfmxCallableStatement.hasOutParameter() method, which return
TRUE
if the function has an OUT parameter.If a function contains an OUT parameter, you must use the CallableStatement.registerOutParameter() method to register the OUT parameter, the setXXX() methods to register the IN and OUT parameter values, and the getXXX() method to retrieve the OUT parameter value.
- The CallableStatement.getMetaData() method
returns
NULL
until the executeQuery() method has been executed. After executeQuery() has been called, the ResultSetMetaData object contains information only for the return value, not the OUT parameter. - You must specify all IN parameters by using setXXX() methods.
You cannot use literals in the SQL statement. For example, the following
statement produces unreliable results:
CallableStatement cstmt = myConn.prepareCall("{call myFunction(25, ?)}");
Instead, use a statement that does not specify literal parameters:CallableStatement cstmt = myConn.prepareCall("{call myFunction(?, ?)}");
Call the setXXX() methods for both parameters.
- Do not close the ResultSet returned by the CallableStatement.executeQuery() method until you have retrieved the OUT parameter value by using a getXXX() method.
- You cannot cast the OUT parameter to a different type in the SQL
statement. For example, the following cast is ignored:
CallableStatement cstmt = myConn.prepareCall("{call foo(?::lvarchar, ?)}";
- The setMaxRows() and registerOutParameter() methods
both take java.sql.Types values as parameters. There are some
one-to-many mappings from java.sql.Types values to HCL
OneDB types.
In addition, some HCL OneDB types do not map to java.sql.Types values. Extensions for setMaxRows() and registerOutParameter() fix these problems. See IN and OUT parameter type mapping.
These restrictions apply to a JDBC application that handles C, SPL, or Java™ UDRs.