Interface DatabaseObjectsFactory

  • All Known Implementing Classes:
    DefaultDatabaseObjectsFactory

    public interface DatabaseObjectsFactory
    Factory for creating connections and prepared statements
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default void clear()
      Free resources
      void init​(javax.sql.DataSource dataSource, ExtProperties properties)
      Initialize the factory with the DataSourceResourceLoader properties
      java.sql.PreparedStatement prepareStatement​(java.lang.String sql)
      Prepare a statement
      void releaseStatement​(java.lang.String sql, java.sql.PreparedStatement stmt)
      Releases a prepared statement
      default void setLogger​(org.slf4j.Logger log)
      Set the logger to be used by the factory
    • Method Detail

      • init

        void init​(javax.sql.DataSource dataSource,
                  ExtProperties properties)
           throws java.sql.SQLException
        Initialize the factory with the DataSourceResourceLoader properties
        Parameters:
        dataSource - data source
        Throws:
        java.sql.SQLException
      • setLogger

        default void setLogger​(org.slf4j.Logger log)
        Set the logger to be used by the factory
        Parameters:
        log -
      • prepareStatement

        java.sql.PreparedStatement prepareStatement​(java.lang.String sql)
                                             throws java.sql.SQLException
        Prepare a statement
        Parameters:
        sql - Statement SQL
        Returns:
        prepared statement
        Throws:
        java.sql.SQLException
      • releaseStatement

        void releaseStatement​(java.lang.String sql,
                              java.sql.PreparedStatement stmt)
                       throws java.sql.SQLException
        Releases a prepared statement
        Parameters:
        sql - original sql query
        stmt - statement
        Throws:
        java.sql.SQLException
      • clear

        default void clear()
        Free resources