Browse Prior Art Database

Efficient Implementation of JDBC CallableStatement Disclosure Number: IPCOM000125129D
Original Publication Date: 2005-May-19
Included in the Prior Art Database: 2005-May-19
Document File: 2 page(s) / 23K

Publishing Venue



To use the Direct Routine Execution mechanism provided by database server to implement CallableStatement and ParameterMetadata Interfaces of JDBC 3.0 specifications.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 52% of the total text.

Page 1 of 2

Efficient Implementation of JDBC CallableStatement

The JDBC 3.0 specifications describe an interface called CallableStatement, to execute user defined routines (commonly called as stored procedures/functions). The user program will pass a statement like '{ call myProcedure(?,?) }' to the JDBC driver, then set the argument values and request the routine execution. where myProcedure is the name of the routine and '?' represents a parameters to that routine. eg.

CallableStatement csmt = myConnection.PrepareCall("{ call myProcedure(?,?) }"); csmt.setInt(1,10); csmt.setInt(2,100); csmt.execute();

In the example above, the JDBC program prepares a statement 'call myProcedure(?,?)'. The argument values are assigned using setXXX() methods. Finally the procedure is executed using execute() method.

This interface is implemented in all the IBM-Informix Dynamic Server (IDS)* products via 'execute procedure/function' SQL statement. The IBM-Informix JDBC driver generates the SQL statement for 'call ... ', then prepares and executes that like any other SQL statement.

The IDS 9.x server supports a mechanism (called FastPath) to directly execute a user defined routine, bypassing the normal SQL processing layers like parser, optimizer etc. It also supports the obtaining metadeta like detatype, mode etc. of the parameter and return value. The caller needs to pass the routine signature containing the routine name, owner and argument data types ( if known). The server validates the information and returns a routine identifier if a matching routine exists in the database. The caller can then use this identifier to pass argument values and request routine execution. The server executes the routin...