Interface DataSourceAdapter

  • All Known Implementing Classes:
    DataSourceAdapter.Apache

    public interface DataSourceAdapter
    An convenience adapter to work with DataSource implementations from different libraries.
    Author:
    Xavier Witdouck
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  DataSourceAdapter.Apache
      A DataSourceFactory that uses Apache Commons DBCP library
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close​(javax.sql.DataSource source)
      Closes the data source if appropriate
      javax.sql.DataSource create​(DatabaseConfig config)
      Returns a newly created DataSource based on the config provided
    • Method Detail

      • close

        void close​(javax.sql.DataSource source)
        Closes the data source if appropriate
        Parameters:
        source - the data source
      • create

        javax.sql.DataSource create​(DatabaseConfig config)
                             throws DatabaseException
        Returns a newly created DataSource based on the config provided
        Parameters:
        config - the database configuration
        Returns:
        the newly created DataSource
        Throws:
        DatabaseException - if operation fails