Class AppConnectionService


  • public final class AppConnectionService
    extends java.lang.Object
    This class provides a Database Connection Service based on pooled connections.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void freeConnection​(java.sql.Connection conn)
      Releases a connection and replaces it in the pool
      static java.sql.Connection getConnection()
      Returns a connection to database from the pool name
      static PluginConnectionService getDefaultConnectionService()
      Returns a default Plugin Connection Service
      static void getPoolList​(ReferenceList list)
      Gets the list of all pools defined in the db.properties file
      static PoolManager getPoolManager()
      Gets a reference on the current Pool Manager
      static void init​(java.lang.String strConfigPath, java.lang.String strConfigFilename, java.lang.String strPoolName)
      Initializes the connection pool and sets the pool manager instance
      static void releasePool()
      Releases all the connections on all the pools
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • init

        public static void init​(java.lang.String strConfigPath,
                                java.lang.String strConfigFilename,
                                java.lang.String strPoolName)
                         throws LuteceInitException
        Initializes the connection pool and sets the pool manager instance
        Parameters:
        strConfigPath - The relative Config path
        strConfigFilename - The config file name
        strPoolName - The pool name
        Throws:
        LuteceInitException - If an error occured
      • getConnection

        public static java.sql.Connection getConnection()
        Returns a connection to database from the pool name
        Returns:
        a connection to database from the pool
      • freeConnection

        public static void freeConnection​(java.sql.Connection conn)
        Releases a connection and replaces it in the pool
        Parameters:
        conn - The connection to realease
      • releasePool

        public static void releasePool()
        Releases all the connections on all the pools
      • getPoolManager

        public static PoolManager getPoolManager()
        Gets a reference on the current Pool Manager
        Returns:
        The current Pool Manager
      • getPoolList

        public static void getPoolList​(ReferenceList list)
        Gets the list of all pools defined in the db.properties file
        Parameters:
        list - The Reference List
      • getDefaultConnectionService

        public static PluginConnectionService getDefaultConnectionService()
        Returns a default Plugin Connection Service
        Returns:
        The connection Service