DB2 10.5 for Linux, UNIX, and Windows

DB2DatabaseMetaData interface

The com.ibm.db2.jcc.DB2DatabaseMetaData interface extends the java.sql.DatabaseMetaData interface.

DB2DatabaseMetaData methods

The following methods are defined only for the IBM® Data Server Driver for JDBC and SQLJ.

getDBFunctionColumns
Format:
public java.sql.ResultSet getDBFunctionColumns(
  String catalog, 
  String schemaPattern, 
  String modulePattern, 
  String functionNamePattern, 
  String columnNamePattern) 
  throws java.sql.SQLException

Returns a ResultSet object that describes parameters and return values for user-defined functions or built-in functions that are defined at a data source. The function parameters and return values for which information is returned match the catalog name, schema pattern, module pattern, function name pattern, and column name pattern that are specified by the input parameters. The ResultSet has the following columns:

Column number Column name Data type Description
1 FUNCTION_CAT String Name of the catalog. The value is null if this function does not have catalogs.
2 FUNCTION_SCHEM String Name of the schema containing FUNCTION_NAME. This value can be null.
3 FUNCTION_NAME String Name of the function.
4 COLUMN_NAME String Name of the function parameter.
5 COLUMN_TYPE Short Parameter type:
  • functionColumnUnknown (0): unknown
  • functionColumnIn (1): input
  • functionColumnInOut (2): input or output
  • functionColumnResult (3): result set column
  • functionColumnOut (4): output
  • functionColumnReturn (5): returned value
6 DATA_TYPE int SQL data type of the parameter that is identified by COLUMN_NAME.
7 TYPE_NAME String Character string representing the name of the data type corresponding to DATA_TYPE.
8 PRECISION int The precision of an exact numeric parameter.
9 LENGTH int The length of the parameter,
10 SCALE short The scale of an exact numeric parameter.
11 RADIX short 10, 2, or null:
  • If DATA_TYPE is an approximate numeric data type, this parameter contains the value 2.
  • If DATA_TYPE is an exact numeric data type, this parameter contains the value 10.
  • For data types where the radix is not applicable, this value is null.
12 NULLABLE short Specifies whether the parameter can contain NULL values:
functionNoNulls (0)
The parameter cannot contains NULL values.
functionNullable (1)
The parameter can contains NULL values.
functionNullableUnknown (2)
The nullability of the parameter is unknown.
13 REMARKS String Descriptive information about the parameter, or null.
14 CHAR_OCTET_LENGTH int For character data types, the maximum number of bytes in the parameter. For the XML type, zero is returned. For all other data types, this value is null.
15 ORDINAL_POSITION int The position of the parameter, starting at 1. This value is 0 if COLUMN_TYPE is 5 (return value).
16 IS_NULLABLE String Contains the string 'NO' if the parameter is known to be not nullable, 'YES' if the parameter is nullable, or an empty string if the nullability is unknown.
17 SPECIFIC_NAME String The name that uniquely identifies the function within its schema.
18 FUNCTION_MODULE String The name of the module that contains the function. This value can be null.
Parameter descriptions:
catalog
An empty string or '%'.
schemaName
Specifies the schema name (qualifier) of the objects for which information is to be returned.

The value can identify a single schema name, or it can identify more than one schema name by including the pattern-matching character percent (%).

modulePattern
Specifies the name of the module for which parameter information is to be returned.

The value can identify a single module name, or it can identify more than one module name by including the pattern-matching character percent (%).

functionNamePattern
Specifies the name of the function for which parameter information is to be returned.

The value can identify a single schema name, or it can identify more than one procedure name by including the pattern-matching character percent (%).

columnNamePattern
Specifies the parameters for which parameter information is to be returned.

The value can identify a single schema name, or it can identify more than one parameter name by including the pattern-matching character percent (%).

This method applies to connections to DB2® for Linux, UNIX, and Windows 9.7 or later data sources only. A SqlFeatureNotSupportedException is thrown if the data source is any other data source.

getDBFunctions
Format:
public java.sql.ResultSet getDBFunctions(
  String catalog, 
  String schemaPattern, 
  String modulePattern, 
  String functionNamePattern) 
  throws java.sql.SQLException

Returns a ResultSet object that describes user-defined functions or built-in functions that are defined at a data source. The functions for which information is returned match the catalog name, schema pattern, module pattern, and function name pattern that are specified by the input parameters. The ResultSet has the following columns:

Column number Column name Data type Description
1 FUNCTION_CAT String Name of the catalog. The value is null if this function does not have catalogs.
2 FUNCTION_SCHEM String Name of the schema containing FUNCTION_NAME. This value can be null.
3 FUNCTION_NAME String Name of the function.
4 REMARKS String Descriptive information about the parameter, or null.
5 FUNCTION_TYPE short Function type. Possible values are:
  • functionResultUnknown (0): Whether a value or a table is returned is unknown.
  • functionNoTable (1): A table is not returned.
  • functionReturnsTable (2): A table is returned.
6 SPECIFIC_NAME String The name that uniquely identifies the function within its schema.
7 FUNCTION_MODULE String The name of the module that contains the function. This value can be null.
Parameter descriptions:
catalog
An empty string or '%'.
schemaName
Specifies the schema name (qualifier) of the objects for which information is to be returned.

The value can identify a single schema name, or it can identify more than one schema name by including the pattern-matching character percent (%).

modulePattern
Specifies the name of the module for which parameter information is to be returned.

The value can identify a single module name, or it can identify more than one module name by including the pattern-matching character percent (%).

functionNamePattern
Specifies the name of the function for which parameter information is to be returned.

The value can identify a single schema name, or it can identify more than one function name by including the pattern-matching character percent (%).

This method applies to connections to DB2 for Linux, UNIX, and Windows 9.7 or later data sources only. A SqlFeatureNotSupportedException is thrown if the data source is any other data source.

getDBProcedureColumns
Format:
public java.sql.ResultSet getDBProcedureColumns(
  String catalog, 
  String schemaPattern, 
  String modulePattern, 
  String procedureNamePattern, 
  String columnNamePattern) 
  throws java.sql.SQLException

Returns a ResultSet object that describes parameters and return values for stored procedures that are defined at a data source. The stored procedure parameters and return values for which information is returned match the catalog name, schema pattern, module pattern, procedure name pattern, and column name pattern that are specified by the input parameters. The ResultSet has the following columns:

Column number Column name Data type Description
1 PROCEDURE_CAT String Name of the catalog. The value is null if this procedure does not have catalogs.
2 PROCEDURE_SCHEM String Name of the schema containing PROCEDURE_NAME. This value can be null.
3 PROCEDURE_NAME String Name of the procedure.
4 COLUMN_NAME String Name of the procedure parameter.
5 COLUMN_TYPE Short Parameter type:
  • procedureColumnUnknown (0): unknown
  • procedureColumnIn (1): input
  • procedureColumnInOut (2): input or output
  • procedureColumnResult (3): result set column
  • procedureColumnOut (4): output
  • procedureColumnReturn (5): returned value
6 DATA_TYPE int SQL data type of the parameter that is identified by COLUMN_NAME.
7 TYPE_NAME String Character string representing the name of the data type corresponding to DATA_TYPE.
8 PRECISION int The precision of an exact numeric parameter.
9 LENGTH int The length of the parameter,
10 SCALE short The scale of an exact numeric parameter.
11 RADIX short 10, 2, or null:
  • If DATA_TYPE is an approximate numeric data type, this parameter contains the value 2.
  • If DATA_TYPE is an exact numeric data type, this parameter contains the value 10.
  • For data types where the radix is not applicable, this value is null.
12 NULLABLE short Specifies whether the parameter can contain NULL values:
procedureNoNulls (0)
The parameter cannot contains NULL values.
procedureNullable (1)
The parameter can contains NULL values.
procedureNullableUnknown (2)
The nullability of the parameter is unknown.
13 REMARKS String Descriptive information about the parameter, or null.
14 COLUMN_DEF String Default value for the parameter.
15 SQL_DATA_TYPE int The value of the SQL data type as it appears in the SQL_DESC_TYPE field of the descriptor.
16 SQL_DATETIME_SUB int The subtype code for datetime data types.
17 CHAR_OCTET_LENGTH int For character data types, the maximum number of bytes in the parameter. For the XML type, zero is returned. For all other data types, this value is null.
18 ORDINAL_POSITION int The position of the parameter, starting at 1. This value is 0 if COLUMN_TYPE is 5 (return value).
19 IS_NULLABLE String Contains the string 'NO' if the parameter is known to be not nullable, 'YES' if the parameter is nullable, or an empty string if the nullability is unknown.
20 SPECIFIC_NAME String The name that uniquely identifies the procedure within its schema.
21 PROCEDURE_MODULE String The name of the module that contains the procedure. This value can be null.
Parameter descriptions:
catalog
An empty string or '%'.
schemaName
Specifies the schema name (qualifier) of the objects for which information is to be returned.

The value can identify a single schema name, or it can identify more than one schema name by including the pattern-matching character percent (%).

modulePattern
Specifies the name of the module for which parameter information is to be returned.

The value can identify a single module name, or it can identify more than one module name by including the pattern-matching character percent (%).

procedureNamePattern
Specifies the name of the procedure for which parameter information is to be returned.

The value can identify a single schema name, or it can identify more than one procedure name by including the pattern-matching character percent (%).

columnNamePattern
Specifies the parameters for which parameter information is to be returned.

The value can identify a single schema name, or it can identify more than one parameter name by including the pattern-matching character percent (%).

This method applies to connections to DB2 for Linux, UNIX, and Windows 9.7 or later data sources only. A SqlFeatureNotSupportedException is thrown if the data source is any other data source.

getDBProcedures
Format:
public java.sql.ResultSet getDBProcedures(
  String catalog, 
  String schemaPattern, 
  String modulePattern, 
  String procedureNamePattern) 
  throws java.sql.SQLException

Returns a ResultSet object that describes stored procedures that are defined at a data source. The stored procedures for which information is returned match the catalog name, schema pattern, module pattern, and procedure name pattern that are specified by the input parameters. The ResultSet has the following columns:

Column number Column name Data type Description
1 PROCEDURE_CAT String Name of the catalog. The value is null if this procedure does not have catalogs.
2 PROCEDURE_SCHEM String Name of the schema containing PROCEDURE_NAME. This value can be null.
3 PROCEDURE_NAME String Name of the procedure.
4     Reserved.
5     Reserved.
6     Reserved.
7 REMARKS String Descriptive information about the parameter, or null.
8 PROCEDURE_TYPE short Procedure type. Possible values are:
  • procedureResultUnknown (0): Whether a value is returned is unknown.
  • procedureNoResult (1): No value is returned.
  • procedureReturnsResult (2): A value is returned.
9 SPECIFIC_NAME String The name that uniquely identifies the procedure within its schema.
10 PROCEDURE_MODULE String The name of the module that contains the procedure. This value can be null.
Parameter descriptions:
catalog
An empty string or '%'.
schemaName
Specifies the schema name (qualifier) of the objects for which information is to be returned.

The value can identify a single schema name, or it can identify more than one schema name by including the pattern-matching character percent (%).

modulePattern
Specifies the name of the module for which parameter information is to be returned.

The value can identify a single module name, or it can identify more than one module name by including the pattern-matching character percent (%).

procedureNamePattern
Specifies the name of the procedure for which parameter information is to be returned.

The value can identify a single schema name, or it can identify more than one procedure name by including the pattern-matching characters percent (%).

This method applies to connections to DB2 for Linux, UNIX, and Windows 9.7 or later data sources only. A SqlFeatureNotSupportedException is thrown if the data source is any other data source.

getDBUDTs
Format:
public java.sql.ResultSet getDBUDTs(
  String catalog, 
  String schemaPattern, 
  String modulePattern, 
  String typeNamePattern,
  int[] types) 
  throws java.sql.SQLException

Returns a ResultSet object that describes user-defined types that are defined at a data source. The user-defined types for which information is returned match the catalog name, schema pattern, module pattern, type name pattern and types that are specified by the input parameters. The ResultSet has the following columns:

Column number Column name Data type Description
1 TYPE_CAT String Name of the catalog. The value is null if this user-defined type does not have catalogs.
2 TYPE_SCHEM String Name of the schema containing TYPE_NAME. This value can be null.
3 TYPE_NAME String Name of the user-defined type.
4 CLASS_NAME String The Java™ class name of the user-defined type.
5 DATA_TYPE int One of the following type values that is defined in java.sql.Types:
  • JAVA_OBJECT (2000)
  • DISTINCT (2001)
  • STRUCT (2002)
6 REMARKS String Descriptive information about the user-defined type, or null.
7 BASE_TYPE short If DATA_TYPE is DISTINCT, or DATA_TYPE is STRUCT and REFERENCE_GENERATION is USER_DEFINED, the type code from java.sql.Types of the data type on which the user-defined type is based. Otherwise, this value is null.
8 TYPE_MODULE String The name of the module that contains the user-defined type. This value can be null.
Parameter descriptions:
catalog
An empty string or '%'.
schemaName
Specifies the schema name (qualifier) of the objects for which information is to be returned.

The value can identify a single schema name, or it can identify more than one schema name by including the pattern-matching character percent (%).

modulePattern
Specifies the name of the module for which parameter information is to be returned.

The value can identify a single module name, or it can identify more than one module name by including the pattern-matching characte percent (%).

typeNamePattern
Specifies the name of the user-defined type for which parameter information is to be returned.

The value can identify a single type name, or it can identify more than one procedure name by including the pattern-matching character percent (%).

types
Specifies the types of user-defined types for which parameter information is to be returned. Each array entry can contain one of the following values:
  • JAVA_OBJECT (2000)
  • DISTINCT (2001)
  • STRUCT (2002)

If the array is null, information about all types is returned.

This method applies to connections to DB2 for Linux, UNIX, and Windows 9.7 or later data sources only. A SqlFeatureNotSupportedException is thrown if the data source is any other data source.

isIDSDatabaseAnsiCompliant
Format:
public boolean isIDSDatabaseAnsiCompliant();

Returns true if the current active IBM Informix® database is ANSI-compliant. Returns false otherwise.

An ANSI-compliant database is a database that was created with the WITH LOG MODE ANSI option.

This method applies to connections to IBM Informix data sources only. An SQLException is thrown if the data source is not an IBM Informix data source.

isIDSDatabaseLogging
Format:
public boolean isIDSDatabaseLogging();

Returns true if the current active IBM Informix database supports logging. Returns false otherwise.

An IBM Informix database that supports logging is a database that was created with the WITH LOG MODE ANSI option, the WITH BUFFERED LOG, or the WITH LOG option.

This method applies to connections to IBM Informix data sources only. An SQLException is thrown if the data source is not an IBM Informix data source.

isResetRequiredForDB2eWLM
Format:
public boolean isResetRequiredForDB2eWLM();

Returns true if the target database server requires clean reuse to support eWLM. Returns false otherwise.

supportsDB2ProgressiveStreaming
Format:
public boolean supportsDB2ProgressiveStreaming();

Returns true if the target data source supports progressive streaming. Returns false otherwise.