Package org.springframework.jdbc.core.metadata

# Interface TableMetaDataProvider

All Known Implementing Classes:
  `DerbyTableMetaDataProvider`, `GenericTableMetaDataProvider`, `HsqlTableMetaDataProvider`, `OracleTableMetaDataProvider`, `PostgresTableMetaDataProvider`

public interface TableMetaDataProvider
Interface specifying the API to be implemented by a class providing table meta-data.

This is intended for internal use by the Simple JDBC classes.

Since:
  2.5
Author:
  Thomas Risberg, Sam Brannen

## Method Summary

Modifier and Type
Method
Description
`String`
`catalogNameToUse(String catalogName)`
Get the catalog name formatted based on meta-data information.
`String`
`columnNameToUse(String columnName)`
Get the column name formatted based on meta-data information.
`String`
`getIdentifierQuoteString()`
Get the string used to quote SQL identifiers.
`String`
`getSimpleQueryForGetGeneratedKey(String tableName, String keyColumnName)`
Get the simple query to retrieve generated keys when the JDBC feature for retrieving generated keys is not supported.
`List<TableParameterMetaData>`
`getTableParameterMetaData()`
Get the table parameter meta-data that is currently used.
`void`
`initializeWithMetaData(DatabaseMetaData databaseMetaData)`
Initialize using the database meta-data provided.
`void`
`initializeWithTableColumnMetaData(DatabaseMetaData databaseMetaData, String catalogName, String schemaName, String tableName)`
Initialize using provided database meta-data, table and column information.
`boolean`
`isGeneratedKeysColumnNameArraySupported()`
Does this database support a column name String array for retrieving generated keys?
`boolean`
`isGetGeneratedKeysSimulated()`
Does this database support a simple query to retrieve generated keys when the JDBC feature for retrieving generated keys is not supported?
`boolean`
`isGetGeneratedKeysSupported()`
Does this database support the JDBC feature for retrieving generated keys?
`boolean`
`isTableColumnMetaDataUsed()`
Are we using the meta-data for the table columns?
`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`
`schemaNameToUse(String schemaName)`
Get the schema name formatted based on meta-data information.
`String`
`tableNameToUse(String tableName)`
Get the table name formatted based on meta-data information.

## Method Details

### initializeWithMetaData

void initializeWithMetaData(DatabaseMetaData databaseMetaData) throws SQLException
Initialize using the database meta-data provided.

Parameters:
  `databaseMetaData` - used to retrieve database specific information
Throws:
  `SQLException` - in case of initialization failure

### initializeWithTableColumnMetaData

void initializeWithTableColumnMetaData(DatabaseMetaData databaseMetaData, @Nullable String catalogName, @Nullable String schemaName, @Nullable String tableName) throws SQLException
Initialize using provided database meta-data, table and column information.

This initialization 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` if none)
  `schemaName` - name of schema name to use (or `null` if none)
  `tableName` - name of the table
Throws:
  `SQLException` - in case of initialization failure

### getTableParameterMetaData

List<TableParameterMetaData> getTableParameterMetaData()
Get the table parameter meta-data that is currently used.

Returns:
  a List of `TableParameterMetaData`

### tableNameToUse

@Nullable String tableNameToUse(@Nullable String tableName)
Get the table name formatted based on meta-data information.

This could include altering the case.

### columnNameToUse

@Nullable String columnNameToUse(@Nullable String columnName)
Get the column name formatted based on meta-data information.

This could include altering the case.

Since:
  6.1

### catalogNameToUse

@Nullable String catalogNameToUse(@Nullable String catalogName)
Get the catalog name formatted based on meta-data information.

This could include altering the case.

### schemaNameToUse

@Nullable String schemaNameToUse(@Nullable String schemaName)
Get the schema name formatted based on meta-data information.

This could include altering the case.

### metaDataCatalogNameToUse

@Nullable String metaDataCatalogNameToUse(@Nullable 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.

### metaDataSchemaNameToUse

@Nullable String metaDataSchemaNameToUse(@Nullable 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.

### isTableColumnMetaDataUsed

boolean isTableColumnMetaDataUsed()
Are we using the meta-data for the table columns?

### isGetGeneratedKeysSupported

boolean isGetGeneratedKeysSupported()
Does this database support the JDBC feature for retrieving generated keys?

See Also:
  - `DatabaseMetaData.supportsGetGeneratedKeys()`

### isGetGeneratedKeysSimulated

boolean isGetGeneratedKeysSimulated()
Does this database support a simple query to retrieve generated keys when the JDBC feature for retrieving generated keys is not supported?

See Also:
  - `isGetGeneratedKeysSupported()`
  - `getSimpleQueryForGetGeneratedKey(String, String)`

### getSimpleQueryForGetGeneratedKey

@Nullable String getSimpleQueryForGetGeneratedKey(String tableName, String keyColumnName)
Get the simple query to retrieve generated keys when the JDBC feature for retrieving generated keys is not supported.

See Also:
  - `isGetGeneratedKeysSimulated()`

### isGeneratedKeysColumnNameArraySupported

boolean isGeneratedKeysColumnNameArraySupported()
Does this database support a column name String array for retrieving generated keys?

See Also:
  - `Connection.createStruct(String, Object[])`

### getIdentifierQuoteString

String getIdentifierQuoteString()
Get the string used to quote SQL identifiers.

This method returns a space (`" "`) if identifier quoting is not supported.

Returns:
  database identifier quote string
Since:
  6.1
See Also:
  - `DatabaseMetaData.getIdentifierQuoteString()`