Class DefaultDatabaseObjectsFactory

  • All Implemented Interfaces:
    DatabaseObjectsFactory

    public class DefaultDatabaseObjectsFactory
    extends java.lang.Object
    implements DatabaseObjectsFactory
    Database objects factory which will obtain a new connection from the data source and prepare needed statements at each call
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultDatabaseObjectsFactory

        public DefaultDatabaseObjectsFactory()
    • Method Detail

      • init

        public void init​(javax.sql.DataSource dataSource,
                         ExtProperties properties)
        Initialize the factory with the DataSourceResourceLoader properties
        Specified by:
        init in interface DatabaseObjectsFactory
        Parameters:
        dataSource - data source
      • prepareStatement

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

        public void releaseStatement​(java.lang.String sql,
                                     java.sql.PreparedStatement stmt)
                              throws java.sql.SQLException
        Releases a prepared statement
        Specified by:
        releaseStatement in interface DatabaseObjectsFactory
        Parameters:
        sql - original sql query
        stmt - statement
        Throws:
        java.sql.SQLException