Top Description Methods
org.springframework.jdbc.core.metadata

public Interface CallMetaDataProvider

Known Direct Implementers
org.springframework.jdbc.core.metadata.GenericCallMetaDataProvider
Imports
java.sql.DatabaseMetaData, .SQLException, java.util.List, org.springframework.jdbc.core.SqlParameter, org.springframework.lang.Nullable

Interface specifying the API to be implemented by a class providing call meta-data.

This is intended for internal use by Spring's org.springframework.jdbc.core.simple.SimpleJdbcCall.

Authors
Thomas Risberg, Juergen Hoeller, Giuseppe Milicia
Since
2.5

Method Summary

Modifier and TypeMethod and Description
public boolean
byPassReturnParameter(String parameterName)

Should we bypass the return parameter with the specified name?

public String
catalogNameToUse(String catalogName)

Provide any modification of the catalog name passed in to match the meta-data currently used.

public SqlParameter

Returns:

the configured SqlInOutParameter
createDefaultInOutParameter
(String
the name of the parameter
parameterName
,
CallParameterMetaData
meta-data used for this call
meta
)

Create a default in/out parameter based on the provided meta-data.

public SqlParameter

Returns:

the configured SqlParameter
createDefaultInParameter
(String
the name of the parameter
parameterName
,
CallParameterMetaData
meta-data used for this call
meta
)

Create a default in parameter based on the provided meta-data.

public SqlParameter

Returns:

the configured SqlOutParameter
createDefaultOutParameter
(String
the name of the parameter
parameterName
,
CallParameterMetaData
meta-data used for this call
meta
)

Create a default out parameter based on the provided meta-data.

public List<CallParameterMetaData>

Returns:

a List of CallParameterMetaData
getCallParameterMetaData
()

Get the call parameter meta-data that is currently used.

public int
getRefCursorSqlType()

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

public String

Returns:

current user name from database connection
getUserName
()

Get the name of the current user.

public void
initializeWithMetaData(DatabaseMetaData
used to retrieve database specific information
databaseMetaData
)

Initialize using the provided DatabaseMetData.

public void
initializeWithProcedureColumnMetaData(DatabaseMetaData
used to retrieve database specific information
databaseMetaData
,
String
name of catalog to use (or null if none)
catalogName
,
String
name of schema name to use (or null if none)
schemaName
,
String
name of the stored procedure
procedureName
)

Initialize the database specific management of procedure column meta-data.

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 java.sql.CallableStatement#getObject(int) for the specified column?

public boolean
isReturnResultSetSupported()

Does this database support returning ResultSets that should be retrieved with the JDBC call: java.sql.Statement#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.

public String
metaDataSchemaNameToUse(String schemaName)

Provide any modification of the schema name passed in to match the meta-data currently used.

public String

Returns:

the name of the named parameter to use for binding the given parameter name
namedParameterBindingToUse
(String
the name of the parameter to bind
parameterName
)

Return the name of the named parameter to use for binding the given parameter name.

public String
parameterNameToUse(String
name of the parameter of column
parameterName
)

Provide any modification of the column name passed in to match the meta-data currently used.

public String
procedureNameToUse(String procedureName)

Provide any modification of the procedure name passed in to match the meta-data currently used.

public String
schemaNameToUse(String schemaName)

Provide any modification of the schema name passed in to match the meta-data currently used.

Method Detail

byPassReturnParameterback to summary
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.

catalogNameToUseback to summary
public String catalogNameToUse(String catalogName)

Provide any modification of the catalog name passed in to match the meta-data currently used.

This could include altering the case.

Annotations
@Nullable
createDefaultInOutParameterback to summary
public SqlParameter createDefaultInOutParameter(String parameterName, CallParameterMetaData meta)

Create a default in/out parameter based on the provided meta-data.

This is used when no explicit parameter declaration has been made.

Parameters
parameterName:String

the name of the parameter

meta:CallParameterMetaData

meta-data used for this call

Returns:SqlParameter

the configured SqlInOutParameter

createDefaultInParameterback to summary
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:String

the name of the parameter

meta:CallParameterMetaData

meta-data used for this call

Returns:SqlParameter

the configured SqlParameter

createDefaultOutParameterback to summary
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:String

the name of the parameter

meta:CallParameterMetaData

meta-data used for this call

Returns:SqlParameter

the configured SqlOutParameter

getCallParameterMetaDataback to summary
public List<CallParameterMetaData> getCallParameterMetaData()

Get the call parameter meta-data that is currently used.

Returns:List<CallParameterMetaData>

a List of CallParameterMetaData

getRefCursorSqlTypeback to summary
public int getRefCursorSqlType()

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

getUserNameback to summary
public String getUserName()

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

Returns:String

current user name from database connection

Annotations
@Nullable
initializeWithMetaDataback to summary
public void initializeWithMetaData(DatabaseMetaData databaseMetaData) throws SQLException

Initialize using the provided DatabaseMetData.

Parameters
databaseMetaData:DatabaseMetaData

used to retrieve database specific information

Exceptions
SQLException:
in case of initialization failure
initializeWithProcedureColumnMetaDataback to summary
public void initializeWithProcedureColumnMetaData(DatabaseMetaData databaseMetaData, String catalogName, String schemaName, String procedureName) throws SQLException

Initialize the database specific management of procedure column meta-data.

This is only called for databases that are supported. This initialization can be turned off by specifying that column meta-data should not be used.

Parameters
databaseMetaData:DatabaseMetaData

used to retrieve database specific information

catalogName:String

name of catalog to use (or null if none)

schemaName:String

name of schema name to use (or null if none)

procedureName:String

name of the stored procedure

Exceptions
SQLException:
in case of initialization failure
See Also
org.springframework.jdbc.core.simple.SimpleJdbcCall#withoutProcedureColumnMetaDataAccess()
isProcedureColumnMetaDataUsedback to summary
public boolean isProcedureColumnMetaDataUsed()

Are we using the meta-data for the procedure columns?

isRefCursorSupportedback to summary
public boolean isRefCursorSupported()

Does this database support returning ResultSets as ref cursors to be retrieved with java.sql.CallableStatement#getObject(int) for the specified column?

isReturnResultSetSupportedback to summary
public boolean isReturnResultSetSupported()

Does this database support returning ResultSets that should be retrieved with the JDBC call: java.sql.Statement#getResultSet()?

isSupportsCatalogsInProcedureCallsback to summary
public boolean isSupportsCatalogsInProcedureCalls()

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

isSupportsSchemasInProcedureCallsback to summary
public boolean isSupportsSchemasInProcedureCalls()

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

metaDataCatalogNameToUseback to summary
public String metaDataCatalogNameToUse(String catalogName)

Provide any modification of the catalog name passed in to match the meta-data currently used.

The returned value will be used for meta-data lookups. This could include altering the case used or providing a base catalog if none is provided.

Annotations
@Nullable
metaDataSchemaNameToUseback to summary
public String metaDataSchemaNameToUse(String schemaName)

Provide any modification of the schema name passed in to match the meta-data currently used.

The returned value will be used for meta-data lookups. This could include altering the case used or providing a base schema if none is provided.

Annotations
@Nullable
namedParameterBindingToUseback to summary
public String namedParameterBindingToUse(String parameterName)

Return the name of the named parameter to use for binding the given parameter name.

Parameters
parameterName:String

the name of the parameter to bind

Returns:String

the name of the named parameter to use for binding the given parameter name

Since
6.1.2
parameterNameToUseback to summary
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:String

name of the parameter of column

Annotations
@Nullable
procedureNameToUseback to summary
public String procedureNameToUse(String procedureName)

Provide any modification of the procedure name passed in to match the meta-data currently used.

This could include altering the case.

Annotations
@Nullable
schemaNameToUseback to summary
public String schemaNameToUse(String schemaName)

Provide any modification of the schema name passed in to match the meta-data currently used.

This could include altering the case.

Annotations
@Nullable