Interface DatabaseMetaDataCallback

All Superinterfaces:
ConnectionCallback

public interface DatabaseMetaDataCallback extends ConnectionCallback
Provides a connection callback specifically for database metadata. This interface safely retrieves the database metadata from a connection and closes the connection after execution.
Author:
jbanes
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    execute(Connection connection)
    Default implementation that obtains metadata from the connection and passes it to the execute(DatabaseMetaData) method.
    void
    Executes operations using the database metadata.
  • Method Details

    • execute

      default void execute(Connection connection) throws SQLException
      Default implementation that obtains metadata from the connection and passes it to the execute(DatabaseMetaData) method.
      Specified by:
      execute in interface ConnectionCallback
      Parameters:
      connection - the JDBC connection to use.
      Throws:
      SQLException - if a database access error occurs.
    • execute

      void execute(DatabaseMetaData metadata) throws SQLException
      Executes operations using the database metadata. Implementations should perform their metadata operations within this method/lambda.
      Parameters:
      metadata - the database metadata object to use.
      Throws:
      SQLException - if a database access error occurs.