Databases Reference
In-Depth Information
getPrecision and getScale
These methods return the precision and the scale of the parameter marker if
the parameter type is decimal.
ResultSetMetaData
This interface provides the methods to get the ResultSet information. This
information is specially needed to retrieve the data when the application does not
know about the column types in the ResultSet. The object of ResultSetMetaData
can be created by calling the getResultSetMetaData method on the ResultSet
object. This interface has the following important methods:
getColumnCount
This method returns the number of columns in the ResultSet object.
getColumnName
This method returns the name of the column in the ResultSet object.
getColumnType
This method returns the data type of the column.
getTableName
This method returns the name of the underlying table for the ResultSet.
isNullable
This method returns true if the ResultSet column can have a null value.
isReadOnly
This method will return true if the column is read-only.
5.5 Stored procedure support
DB2 supports the Java stored procedure, which can be run on the server side by
the application. Follow these guidelines to create the Java stored procedure:
The method in the class, which will map to the stored procedure, must be
defined as public static void method.
Output and InOut parameters must be set up as a single element array.
To create, register, and use a Java stored procedure in an application, follow
these steps:
1. Write a Java program with the stored procedure method. The method should
be public static void.
2. Compile the program using the Java compiler.
3. Copy the .class file of the program to sqllib/function directory on server
side. If you declare a class to be part of the Java package, create
Search WWH ::




Custom Search