Interface IDBDatasourceService

All Known Subinterfaces:
IJndiDatasourceService, IPooledDatasourceService

public interface IDBDatasourceService
This interface defines Pentaho's DatasourceService API. You should implement it if you want to create your own DB data sources management system.
Author:
Ramaiz Mansoor (rmansoor@pentaho.org)
  • Field Details

  • Method Details

    • clearCache

      void clearCache()
      This method clears the whole JNDI data source cache. The need exists because after a JNDI connection is edited the old data source must be removed from the cache.
    • clearDataSource

      void clearDataSource(String dsName)
      This method clears the specified JNDI data source from cache. The need exists because after a JNDI connection is edited the old data source must be removed from the cache.
      Parameters:
      dsName - The name of the data source to be removed from the cache.
    • getDataSource

      DataSource getDataSource(String dsName) throws DBDatasourceServiceException
      Since JNDI is supported in different ways by different application servers, it's nearly impossible to have a standard way to look up a data source. This method hides all of the lookups that may be required to find a JNDI name.
      Parameters:
      dsName - The data source name.
      Returns:
      Returns DataSource if there is one bound in JNDI.
      Throws:
      DBDatasourceServiceException
    • getDSBoundName

      String getDSBoundName(String dsName) throws DBDatasourceServiceException
      Since JNDI is supported in different ways by different application servers, it's nearly impossible to have a standard way to look up a data source. This method hides all the lookups that may be required to find a JNDI name, and returns the actual bound name.
      Parameters:
      dsName - The Datasource name (e.g. SampleData).
      Returns:
      Returns the bound data source name if it is bound in JNDI (e.g. "jdbc/SampleData").
      Throws:
      DBDatasourceServiceException
    • getDSUnboundName

      String getDSUnboundName(String dsName)
      Since JNDI is supported in different ways by different application servers, it's nearly impossible to have a standard way to look up a data source. This method extracts the regular name of a specified JNDI source.
      Parameters:
      dsName - The data source name (e.g. "jdbc/SampleData").
      Returns:
      Returns the unbound data source name (e.g. "SampleData").
    • resolveDatabaseConnection

      DataSource resolveDatabaseConnection(org.pentaho.database.model.IDatabaseConnection databaseConnection) throws DBDatasourceServiceException
      Throws:
      DBDatasourceServiceException