Class DatabaseSupport

    • Constructor Summary

      Constructors 
      Constructor Description
      DatabaseSupport​(java.util.Properties dbProperties, DbType dbType)
      Public constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void commitTransaction()
      Commit the current transaction if there's an actual connection associated with this thread (i.e.
      void describe​(java.lang.String prefix, java.lang.StringBuilder cfg, java.lang.String key)
      Describe self, for writing configuration information to log file for test record purposes
      java.sql.Connection getConnection()
      Obtain a new connection to a data-source which this provider has been configured for.
      IDatabaseAdapter getDatabaseAdapter()
      Get the configured database adapter
      ITransaction getTransaction()
      Obtain the transaction to use on this thread
      IDatabaseTranslator getTranslator()
      Get the IDatabaseTranslator for the configured database type
      void init()
      Build the database configuration from the configured properties
      void rollbackTransaction()
      Roll back the transaction for the connection associated with this thread, if one exists
      • Methods inherited from class java.lang.Object

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

      • DatabaseSupport

        public DatabaseSupport​(java.util.Properties dbProperties,
                               DbType dbType)
        Public constructor
        Parameters:
        dbProperties -
        dbType -
    • Method Detail

      • init

        public void init()
        Build the database configuration from the configured properties
      • getDatabaseAdapter

        public IDatabaseAdapter getDatabaseAdapter()
        Get the configured database adapter
        Returns:
      • getConnection

        public java.sql.Connection getConnection()
                                          throws java.sql.SQLException
        Description copied from interface: IConnectionProvider
        Obtain a new connection to a data-source which this provider has been configured for.
        Specified by:
        getConnection in interface IConnectionProvider
        Returns:
        Throws:
        java.sql.SQLException
      • commitTransaction

        public void commitTransaction()
                               throws java.sql.SQLException
        Description copied from interface: IConnectionProvider
        Commit the current transaction if there's an actual connection associated with this thread (i.e. if getConnection() has been called at least once), otherwise do nothing.
        Specified by:
        commitTransaction in interface IConnectionProvider
        Throws:
        java.sql.SQLException
      • rollbackTransaction

        public void rollbackTransaction()
                                 throws java.sql.SQLException
        Description copied from interface: IConnectionProvider
        Roll back the transaction for the connection associated with this thread, if one exists
        Specified by:
        rollbackTransaction in interface IConnectionProvider
        Throws:
        java.sql.SQLException
      • describe

        public void describe​(java.lang.String prefix,
                             java.lang.StringBuilder cfg,
                             java.lang.String key)
        Description copied from interface: IConnectionProvider
        Describe self, for writing configuration information to log file for test record purposes
        Specified by:
        describe in interface IConnectionProvider