Class ConnectionFactoryImpl

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void configured​(boolean flag)
      INTERNAL Marks Connectionfactory as fully configured
      boolean equals​(Object obj)
      Determines whether obj is a ConnectionFactoryImpl with the same configuration
      Connection getConnection()
      Returns java.sql.Connection
      String getDriverName()
      Returns JDBC driver name
      int getLoginTimeout()
      Returns the number of seconds to wait for a new connection to be established to the data source
      PrintWriter getLogWriter()
      Returns the LogWriter to which messages should be sent
      int getMaxPool()
      Returns maximum number of connections in the connection pool
      int getMinPool()
      Returns minimum number of connections in the connection pool
      int getMsInterval()
      Returns the amount of time, in milliseconds, between the connection manager's attempts to get a pooled connection.
      int getMsWait()
      Returns the number of milliseconds to wait for an available connection from the connection pool before throwing an exception
      int getTransactionIsolation()
      Gets this ConnectionFactory's current transaction isolation level.
      String getURL()
      Returns connection URL
      String getUserName()
      Returns database user name
      int hashCode()
      Computes the hash code of this ConnectionFactoryImpl.
      void setDriverName​(String driverName)
      Sets JDBC driver name
      void setLoginTimeout​(int loginTimeout)
      Sets the number of seconds to wait for a new connection to be established to the data source
      void setLogWriter​(PrintWriter logWriter)
      Sets the LogWriter to which messages should be sent
      void setMaxPool​(int maxPool)
      Sets maximum number of connections in the connection pool
      void setMinPool​(int minPool)
      Sets minimum number of connections in the connection pool
      void setMsInterval​(int msInterval)
      Sets the amount of time, in milliseconds, between the connection manager's attempts to get a pooled connection.
      void setMsWait​(int msWait)
      Sets the number of milliseconds to wait for an available connection from the connection pool before throwing an exception
      void setPassword​(char[] password)
      Sets database user password
      void setTransactionIsolation​(int level)
      Sets transaction isolation level for all connections of this ConnectionFactory.
      void setURL​(String URL)
      Sets JDBC connection URL
      void setUserName​(String userName)
      Sets database user
    • Constructor Detail

      • ConnectionFactoryImpl

        public ConnectionFactoryImpl()
        Creates new default ConnectionFactoryImpl object
      • ConnectionFactoryImpl

        public ConnectionFactoryImpl​(String URL,
                                     String userName,
                                     char[] password,
                                     String driverName)
        Creates new ConnectionFactoryImpl object with user info
        Parameters:
        URL - connection URL
        userName - database user
        password - database user password
        driverName - driver name
      • ConnectionFactoryImpl

        public ConnectionFactoryImpl​(String URL,
                                     String userName,
                                     char[] password,
                                     String driverName,
                                     int minPool,
                                     int maxPool)
        Creates new ConnectionFactoryImpl object with user and connection info
        Parameters:
        URL - connection URL
        userName - database user
        password - database user password
        driverName - driver name
        minPool - minimum number of connections
        maxPool - maximum number of connections
    • Method Detail

      • setDriverName

        public void setDriverName​(String driverName)
        Sets JDBC driver name
        Specified by:
        setDriverName in interface ConnectionFactory
        Parameters:
        driverName - JDBC driver name
      • setURL

        public void setURL​(String URL)
        Sets JDBC connection URL
        Specified by:
        setURL in interface ConnectionFactory
        Parameters:
        URL - connection URL
      • setUserName

        public void setUserName​(String userName)
        Sets database user
        Specified by:
        setUserName in interface ConnectionFactory
        Parameters:
        userName - database user
      • setPassword

        public void setPassword​(char[] password)
        Sets database user password
        Specified by:
        setPassword in interface ConnectionFactory
        Parameters:
        password - database user password
      • setMinPool

        public void setMinPool​(int minPool)
        Sets minimum number of connections in the connection pool
        Specified by:
        setMinPool in interface ConnectionFactory
        Parameters:
        minPool - minimum number of connections
      • getMinPool

        public int getMinPool()
        Returns minimum number of connections in the connection pool
        Specified by:
        getMinPool in interface ConnectionFactory
        Returns:
        connection minPool
      • setMaxPool

        public void setMaxPool​(int maxPool)
        Sets maximum number of connections in the connection pool
        Specified by:
        setMaxPool in interface ConnectionFactory
        Parameters:
        maxPool - maximum number of connections
      • getMaxPool

        public int getMaxPool()
        Returns maximum number of connections in the connection pool
        Specified by:
        getMaxPool in interface ConnectionFactory
        Returns:
        connection maxPool
      • setMsInterval

        public void setMsInterval​(int msInterval)
        Sets the amount of time, in milliseconds, between the connection manager's attempts to get a pooled connection.
        Specified by:
        setMsInterval in interface ConnectionFactory
        Parameters:
        msInterval - the interval between attempts to get a database connection, in milliseconds.
      • getMsInterval

        public int getMsInterval()
        Returns the amount of time, in milliseconds, between the connection manager's attempts to get a pooled connection.
        Specified by:
        getMsInterval in interface ConnectionFactory
        Returns:
        the length of the interval between tries in milliseconds
      • setMsWait

        public void setMsWait​(int msWait)
        Sets the number of milliseconds to wait for an available connection from the connection pool before throwing an exception
        Specified by:
        setMsWait in interface ConnectionFactory
        Parameters:
        msWait - number in milliseconds
      • getMsWait

        public int getMsWait()
        Returns the number of milliseconds to wait for an available connection from the connection pool before throwing an exception
        Specified by:
        getMsWait in interface ConnectionFactory
        Returns:
        number in milliseconds
      • setLogWriter

        public void setLogWriter​(PrintWriter logWriter)
        Sets the LogWriter to which messages should be sent
        Specified by:
        setLogWriter in interface ConnectionFactory
        Parameters:
        logWriter - logWriter
      • setLoginTimeout

        public void setLoginTimeout​(int loginTimeout)
        Sets the number of seconds to wait for a new connection to be established to the data source
        Specified by:
        setLoginTimeout in interface ConnectionFactory
        Parameters:
        loginTimeout - wait time in seconds
      • getLoginTimeout

        public int getLoginTimeout()
        Returns the number of seconds to wait for a new connection to be established to the data source
        Specified by:
        getLoginTimeout in interface ConnectionFactory
        Returns:
        wait time in seconds
      • setTransactionIsolation

        public void setTransactionIsolation​(int level)
        Sets transaction isolation level for all connections of this ConnectionFactory. All validation is done by java.sql.Connection itself, so e.g. while Oracle will not allow to set solation level to TRANSACTION_REPEATABLE_READ, this method does not have any explicit restrictions
        Specified by:
        setTransactionIsolation in interface ConnectionFactory
        Parameters:
        level - - one of the java.sql.Connection.TRANSACTION_* isolation values
      • getTransactionIsolation

        public int getTransactionIsolation()
        Gets this ConnectionFactory's current transaction isolation level.
        Specified by:
        getTransactionIsolation in interface ConnectionFactory
        Returns:
        the current transaction isolation mode value as java.sql.Connection.TRANSACTION_*
      • equals

        public boolean equals​(Object obj)
        Determines whether obj is a ConnectionFactoryImpl with the same configuration
        Overrides:
        equals in class Object
        Parameters:
        obj - The possibly null object to check.
        Returns:
        true if obj is equal to this ConnectionFactoryImpl; false otherwise.
      • hashCode

        public int hashCode()
        Computes the hash code of this ConnectionFactoryImpl.
        Overrides:
        hashCode in class Object
        Returns:
        A hash code of the owning ConnectionFactoryImpl as an int.
      • configured

        public void configured​(boolean flag)
        INTERNAL Marks Connectionfactory as fully configured
        Parameters:
        flag - boolean flag