Interface DatabaseConfig

All Known Implementing Classes:
SQLiteDatabaseConfig

public interface DatabaseConfig
Interface for database configuration and operations. Defines the contract for accessing, initializing, and managing database connections. Implementations provide database-specific functionality while sharing a common interface.
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static void
    Creates a backup of the current database.
    static void
    Closes the data source, releasing any resources if necessary.
    static DataSource
    Gets the configured data source for database connections.
    static void
    Initializes the data source with appropriate configuration settings.
    static void
    Initializes the database schema for a new or existing database.
  • Method Details

    • getDataSource

      static DataSource getDataSource()
      Gets the configured data source for database connections.
      Returns:
      The data source to use for obtaining database connections
    • initializeSchema

      static void initializeSchema(Connection conn)
      Initializes the database schema for a new or existing database.
      Parameters:
      conn - An open database connection
    • initializeDataSource

      static void initializeDataSource()
      Initializes the data source with appropriate configuration settings.
    • backup

      static void backup()
      Creates a backup of the current database. Implementation-specific method for database backup.
    • closeDataSource

      static void closeDataSource()
      Closes the data source, releasing any resources if necessary. Should be called when the application is shutting down.