The SQL 92 and 99 standards specify a DESCRIBE INPUT statement for Dynamic SQL. Version 9.4 of IBM Informix Dynamic Server provides support for this statement. (For more information on SQL standards, syntax, and this statement, see IBM Informix: Guide to SQL Syntax.)
The JDBC 3.0 specification introduces a ParameterMetaData class and methods that correspond to DESCRIBE INPUT support.
The IBM Informix JDBC Driver implements the java.sql.ParameterMetaData class. This interface is used for describing input parameters in prepared statements. The method getParameterMetaData() has been implemented to retrieve the metadata for a particular statement.
The ParameterMetaData class and the getParameterMetaData() method are part of the JDBC 3.0 API and are included as interfaces in J2SDK1.4.0. Details of these interfaces are specified in the JDBC 3.0 specification.
The IBM Informix JDBC Driver has implemented additional methods to the ParameterMetaData interface to extend its functionality, as shown in the following table.
Below is an example of using the ParameterMetaData interface in the IBM Informix JDBC Driver:
. . . try { PreparedStatement pstmt = null; pstmt = myConn.prepareStatement( "select * from table_1 where int_col = ? " +"and string_col = ?"); ParameterMetaData paramMeta = pstmt.getParameterMetaData(); int count = paramMeta.getParameterCount(); System.out.println("Count : "+count); for (int i=1; i <= count; i++) { System.out.println("Parameter type name : " +paramMeta.getParameterTypeName(i)); System.out.println("Parameter type : " +paramMeta.getParameterType(i)); System.out.println("Parameter class name : " +paramMeta.getParameterClassName(i)); System.out.println("Parameter mode : " +paramMeta.getParameterMode(i)); System.out.println("Parameter precision : " +paramMeta.getPrecision(i)); System.out.println("Parameter scale : " +paramMeta.getScale(i)); System.out.println("Parameter nullable : " +paramMeta.isNullable(i)); System.out.println("Parameter signed : " +paramMeta.isSigned(i)); } . . .Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]