Interface IConnectionProvider

All Known Implementing Classes:
DataSourceConnectionProvider

public interface IConnectionProvider
Provides JDBC connections.

Author:
Javier Paniza
  • Method Details

    • getConnection

      Connection getConnection() throws SQLException
      Returns a JDBC connection by default.

      Throws:
      SQLException - If there are problem obtaining the connetion
    • getConnection

      Connection getConnection(String dataSourceName) throws SQLException
      Returns a JDBC connection from a identifier.

      Parameters:
      dataSourceName - Name of data source from what I obtain the connection
      Throws:
      SQLException - If there are problem obtaining the connetion
    • setPassword

      void setPassword(String password)
      Sets password used to create connection.

      * Must to call to setUser(java.lang.String) too. Although set user and password is not mandatory.

    • setDefaultDataSource

      void setDefaultDataSource(String dataSourceName)
      Sets the datasource name used when using getConnection().
    • setUser

      void setUser(String user)
      Sets the user used to craete the connection.

      It is not mandatory to call this method.