java.sql.DatabaseMetaData Interface

The following sections describe java.sql.DatabaseMetaData functionality in GemFire XD.

DatabaseMetaData Result Sets

DatabaseMetaData result sets do not close the result sets of other statements, even when auto-commit is set to true.

DatabaseMetaData result sets are closed if a user performs any other action on a JDBC object that causes an automatic commit to occur. If you need the DatabaseMetaData result sets to be accessible while executing other actions that would cause automatic commits, turn off auto-commit with setAutoCommit(false).

java.sql.DatabaseMetaData.getProcedureColumns Method

GemFire XD supports Java procedures and allows you to call Java procedures within SQL statements. GemFire XD returns information about the parameters in the getProcedureColumns call and returns information for all Java procedures defined by CREATE PROCEDURE.

getProcedureColumns returns a ResultSet. Each row describes a single parameter or return value.

Parameters to getProcedureColumns

The JDBC API defines the following parameters for the getProcedureColumns method call.

Always use null for this parameter in GemFire XD.
Java procedures have a schema.
A String object representing a procedure name pattern.
A String object representing the name pattern of the parameter names or return value names. Java procedures have parameter names matching those defined in the CREATE PROCEDURE statement. Use "%" to find all parameter names.

Columns in the ResultSet Returned by getProcedureColumns

Columns in the ResultSet returned by getProcedureColumns are as described by the API. Further details for some specific columns:

Always "null" in GemFire XD.
Schema for a Java procedure.
Name of the procedure.
Name of the parameter. See column-Name-Pattern under Parameters to getProcedureColumns.
Short indicating what the row describes. It is always DatabaseMetaData.procedureColumnIn for method parameters, unless the parameter is an array. If so, it is DatabaseMetaData.procedureColumnInOut. It always returns DatabaseMetaData.procedureColumnReturn for return values.
GemFire XD-specific name for the type.
Always returns DatabaseMetaData.procedureNoNulls for primitive parameters and DatabaseMetaData.procedureNullable for object parameters
String describing the java type of the method parameter.
String describing the default value for the column (may be null).
Reserved by JDBC spec for future use.
Reserved by JDBC spec for future use.
Maximum length of binary and character based columns (or any other datatype the returned value is a NULL).
Ordinal position, starting from 1, for the input and output parameters for a procedure.
String describing the parameter's nullability (YES means parameter can include NULLs, NO means it cannot).
Name that uniquely identifies this procedure within its schema.
GemFire XD-specific column.
GemFire XD-specific column.

java.sql.DatabaseMetaData.getBestRowIdentifier Method

The java.sql.DatabaseMetaData.getBestRowIdentifier method looks for identifiers in the following order:

This order might not return a unique row.

Note: If the java.sql.DatabaseMetaData.getBestRowIdentifier method does not find a primary key, unique constraint, or unique index, the method must look for identifiers in all of the columns in the table. When the method looks for identifiers this way, the method will always find a set of columns that identify a row. However, a unique row might not be identified if there are duplicate rows in the table.