Class FactoryMethodConnectionSource

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static FactoryMethodConnectionSource createConnectionSource​(java.lang.String className, java.lang.String methodName)
      Factory method for creating a connection source within the plugin manager.
      java.sql.Connection getConnection()
      This should return a new connection every time it is called.
      java.lang.String toString()
      All implementations must override Object.toString() to provide information about the connection configuration (obscuring passwords with one-way hashes).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getConnection

        public java.sql.Connection getConnection()
                                          throws java.sql.SQLException
        Description copied from interface: ConnectionSource
        This should return a new connection every time it is called.
        Specified by:
        getConnection in interface ConnectionSource
        Returns:
        the SQL connection object.
        Throws:
        java.sql.SQLException - if a database error occurs.
      • toString

        public java.lang.String toString()
        Description copied from interface: ConnectionSource
        All implementations must override Object.toString() to provide information about the connection configuration (obscuring passwords with one-way hashes).
        Specified by:
        toString in interface ConnectionSource
        Overrides:
        toString in class java.lang.Object
        Returns:
        the string representation of this connection source.
      • createConnectionSource

        @PluginFactory
        public static FactoryMethodConnectionSource createConnectionSource​(@PluginAttribute("class")
                                                                           java.lang.String className,
                                                                           @PluginAttribute("method")
                                                                           java.lang.String methodName)
        Factory method for creating a connection source within the plugin manager.
        Parameters:
        className - The name of a public class that contains a static method capable of returning either a DataSource or a Connection.
        methodName - The name of the public static method on the aforementioned class that returns the data source or connection. If this method returns a Connection, it should return a new connection every call.
        Returns:
        the created connection source.