public class

GenericCallMetaDataProvider

extends Object
implements CallMetaDataProvider
java.lang.Object
   ↳ org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
Known Direct Subclasses

Class Overview

Generic implementation for the CallMetaDataProvider interface. This class can be extended to provide database specific behavior.

Summary

Fields
protected static final Log logger Logger available to subclasses
Protected Constructors
GenericCallMetaDataProvider(DatabaseMetaData databaseMetaData)
Constructor used to initialize with provided database meta data.
Public Methods
boolean byPassReturnParameter(String parameterName)
Should we bypass the return parameter with the specified name.
String catalogNameToUse(String catalogName)
Provide any modification of the catalog name passed in to match the meta data currently used.
SqlParameter createDefaultInOutParameter(String parameterName, CallParameterMetaData meta)
Create a default inout parameter based on the provided meta data.
SqlParameter createDefaultInParameter(String parameterName, CallParameterMetaData meta)
Create a default in parameter based on the provided meta data.
SqlParameter createDefaultOutParameter(String parameterName, CallParameterMetaData meta)
Create a default out parameter based on the provided meta data.
List<CallParameterMetaData> getCallParameterMetaData()
Get the call parameter metadata that is currently used.
int getRefCursorSqlType()
Get the java.sql.Types type for columns that return resultsets as ref cursors if this feature is supported.
String getUserName()
Get the name of the current user.
void initializeWithMetaData(DatabaseMetaData databaseMetaData)
Initialize using the provided DatabaseMetData.
void initializeWithProcedureColumnMetaData(DatabaseMetaData databaseMetaData, String catalogName, String schemaName, String procedureName)
Initialize the database specific management of procedure column meta data.
boolean isProcedureColumnMetaDataUsed()
Are we using the meta data for the procedure columns?
boolean isRefCursorSupported()
Does this database support returning resultsets as ref cursors to be retrieved with getObject(int) for the specified column.
boolean isReturnResultSetSupported()
Does this database support returning resultsets that should be retrieved with the JDBC call getResultSet()
boolean isSupportsCatalogsInProcedureCalls()
Does the database support the use of catalog name in procedure calls
boolean isSupportsSchemasInProcedureCalls()
Does the database support the use of schema name in procedure calls
String metaDataCatalogNameToUse(String catalogName)
Provide any modification of the catalog name passed in to match the meta data currently used.
String metaDataSchemaNameToUse(String schemaName)
Provide any modification of the schema name passed in to match the meta data currently used.
String parameterNameToUse(String parameterName)
Provide any modification of the column name passed in to match the meta data currently used.
String procedureNameToUse(String procedureName)
Provide any modification of the procedure name passed in to match the meta data currently used.
String schemaNameToUse(String schemaName)
Provide any modification of the schema name passed in to match the meta data currently used.
Protected Methods
boolean isStoresLowerCaseIdentifiers()
Does the database use lower case for identifiers
boolean isStoresUpperCaseIdentifiers()
Does the database use upper case for identifiers
void setStoresLowerCaseIdentifiers(boolean storesLowerCaseIdentifiers)
Specify whether the database uses lower case for identifiers
void setStoresUpperCaseIdentifiers(boolean storesUpperCaseIdentifiers)
Specify whether the database uses upper case for identifiers
void setSupportsCatalogsInProcedureCalls(boolean supportsCatalogsInProcedureCalls)
Specify whether the database supports the use of catalog name in procedure calls
void setSupportsSchemasInProcedureCalls(boolean supportsSchemasInProcedureCalls)
Specify whether the database supports the use of schema name in procedure calls
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.jdbc.core.metadata.CallMetaDataProvider

Fields

protected static final Log logger

Logger available to subclasses

Protected Constructors

protected GenericCallMetaDataProvider (DatabaseMetaData databaseMetaData)

Constructor used to initialize with provided database meta data.

Parameters
databaseMetaData meta data to be used
Throws
SQLException

Public Methods

public boolean byPassReturnParameter (String parameterName)

Should we bypass the return parameter with the specified name. This allows the database specific implementation to skip the processing for specific results returned by the database call.

public String catalogNameToUse (String catalogName)

Provide any modification of the catalog name passed in to match the meta data currently used. This could include alterig the case.

public SqlParameter createDefaultInOutParameter (String parameterName, CallParameterMetaData meta)

Create a default inout parameter based on the provided meta data. This is used when no explicit parameter declaration has been made.

Parameters
parameterName the name of the parameter
meta meta data used for this call
Returns
  • the configured SqlInOutParameter

public SqlParameter createDefaultInParameter (String parameterName, CallParameterMetaData meta)

Create a default in parameter based on the provided meta data. This is used when no explicit parameter declaration has been made.

Parameters
parameterName the name of the parameter
meta meta data used for this call
Returns
  • the configured SqlParameter

public SqlParameter createDefaultOutParameter (String parameterName, CallParameterMetaData meta)

Create a default out parameter based on the provided meta data. This is used when no explicit parameter declaration has been made.

Parameters
parameterName the name of the parameter
meta meta data used for this call
Returns
  • the configured SqlOutParameter

public List<CallParameterMetaData> getCallParameterMetaData ()

Get the call parameter metadata that is currently used.

Returns

public int getRefCursorSqlType ()

Get the java.sql.Types type for columns that return resultsets as ref cursors if this feature is supported.

public String getUserName ()

Get the name of the current user. Useful for meta data lookups etc.

Returns
  • current user name from database connection

public void initializeWithMetaData (DatabaseMetaData databaseMetaData)

Initialize using the provided DatabaseMetData.

Parameters
databaseMetaData used to retrieve database specific information
Throws
SQLException

public void initializeWithProcedureColumnMetaData (DatabaseMetaData databaseMetaData, String catalogName, String schemaName, String procedureName)

Initialize the database specific management of procedure column meta data. This is only called for databases that are supported. This initalization can be turned off by specifying that column meta data should not be used.

Parameters
databaseMetaData used to retrieve database specific information
catalogName name of catalog to use or null
schemaName name of schema name to use or null
procedureName name of the stored procedure
Throws
SQLException

public boolean isProcedureColumnMetaDataUsed ()

Are we using the meta data for the procedure columns?

public boolean isRefCursorSupported ()

Does this database support returning resultsets as ref cursors to be retrieved with getObject(int) for the specified column.

public boolean isReturnResultSetSupported ()

Does this database support returning resultsets that should be retrieved with the JDBC call getResultSet()

public boolean isSupportsCatalogsInProcedureCalls ()

Does the database support the use of catalog name in procedure calls

public boolean isSupportsSchemasInProcedureCalls ()

Does the database support the use of schema name in procedure calls

public String metaDataCatalogNameToUse (String catalogName)

Provide any modification of the catalog name passed in to match the meta data currently used. The reyurned value will be used for meta data lookups. This could include alterig the case used or providing a base catalog if mone provided.

public String metaDataSchemaNameToUse (String schemaName)

Provide any modification of the schema name passed in to match the meta data currently used. The reyurned value will be used for meta data lookups. This could include alterig the case used or providing a base schema if mone provided.

public String parameterNameToUse (String parameterName)

Provide any modification of the column name passed in to match the meta data currently used. This could include altering the case.

Parameters
parameterName name of the parameter of column

public String procedureNameToUse (String procedureName)

Provide any modification of the procedure name passed in to match the meta data currently used. This could include alterig the case.

public String schemaNameToUse (String schemaName)

Provide any modification of the schema name passed in to match the meta data currently used. This could include alterig the case.

Protected Methods

protected boolean isStoresLowerCaseIdentifiers ()

Does the database use lower case for identifiers

protected boolean isStoresUpperCaseIdentifiers ()

Does the database use upper case for identifiers

protected void setStoresLowerCaseIdentifiers (boolean storesLowerCaseIdentifiers)

Specify whether the database uses lower case for identifiers

protected void setStoresUpperCaseIdentifiers (boolean storesUpperCaseIdentifiers)

Specify whether the database uses upper case for identifiers

protected void setSupportsCatalogsInProcedureCalls (boolean supportsCatalogsInProcedureCalls)

Specify whether the database supports the use of catalog name in procedure calls

protected void setSupportsSchemasInProcedureCalls (boolean supportsSchemasInProcedureCalls)

Specify whether the database supports the use of schema name in procedure calls