Class JDBCConfiguration


  • public class JDBCConfiguration
    extends Object
    Class JDBCUtil provides the Utility functions to create JDBC resources
    • Constructor Detail

      • JDBCConfiguration

        public JDBCConfiguration()
    • Method Detail

      • buildDataSource

        public void buildDataSource​(Map<String,​Object> parameters)
        Creating datasource at startup using configured parameters
        Parameters:
        parameters - - parameters given in configuration
      • createCustomDataSource

        protected DataSource createCustomDataSource()
        Create a custom DataSource using the specified data source information.
        Returns:
        a DataSource created using specified properties
      • getConnection

        public Connection getConnection()
                                 throws SQLException
        Get a Connection from current datasource
        Returns:
        - Connection
        Throws:
        SQLException - - Failure in creating datasource connection
      • getDSName

        public String getDSName()
        Return the name or (hopefully) unique connection URL specific to the DataSource being used This is used for logging purposes only
        Returns:
        a unique name or URL to refer to the DataSource being used
      • setDataSourceInformation

        public void setDataSourceInformation​(org.apache.synapse.commons.datasource.DataSourceInformation dataSourceInformation)
        Set DataSourceInformation
        Parameters:
        dataSourceInformation - - information to set
      • setJndiProperties

        public void setJndiProperties​(Properties jndiProperties)
        Set JNDI Properties
        Parameters:
        jndiProperties - - properties to set
      • getDataSource

        public DataSource getDataSource()
        Get datasource
        Returns:
        - Datasource currently in use
      • setDataSourceName

        public void setDataSourceName​(String dataSourceName)
        Get datasource name currently in use
        Parameters:
        dataSourceName - - Datasource name
      • getTableName

        public String getTableName()
        Table name in use
        Returns:
        - Name of the table