Class ClientConnectionPoolDataSource

    • Field Detail

      • msgUtil

        private static final MessageUtil msgUtil
        Message utility used to obtain localized messages.
      • maxStatements

        private int maxStatements
        Specifies the maximum number of statements that can be cached per connection by the JDBC driver.

        A value of 0 disables statement caching, negative values are not allowed. The default is that caching is disabled.

    • Constructor Detail

      • ClientConnectionPoolDataSource

        public ClientConnectionPoolDataSource()
    • Method Detail

      • getPooledConnection

        public javax.sql.PooledConnection getPooledConnection()
                                                       throws java.sql.SQLException
        Specified by:
        getPooledConnection in interface javax.sql.ConnectionPoolDataSource
        Throws:
        java.sql.SQLException
      • getPooledConnection

        public javax.sql.PooledConnection getPooledConnection​(java.lang.String user,
                                                              java.lang.String password)
                                                       throws java.sql.SQLException
        Specified by:
        getPooledConnection in interface javax.sql.ConnectionPoolDataSource
        Throws:
        java.sql.SQLException
      • setMaxStatements

        public void setMaxStatements​(int maxStatements)
        Specifies the maximum size of the statement cache.
        Specified by:
        setMaxStatements in interface ClientConnectionPoolDataSourceInterface
        Parameters:
        maxStatements - maximum number of cached statements
        Throws:
        java.lang.IllegalArgumentException - if maxStatements is negative
      • getMaxStatements

        public int getMaxStatements()
        Returns the maximum number of JDBC prepared statements a connection is allowed to cache.
        Specified by:
        getMaxStatements in interface ClientConnectionPoolDataSourceInterface
        Returns:
        Maximum number of statements to cache, or 0 if caching is disabled (default).
      • validateState

        private final void validateState()
        Make sure the state of the de-serialized object is valid.
      • readObject

        private void readObject​(java.io.ObjectInputStream inputStream)
                         throws java.lang.ClassNotFoundException,
                                java.io.IOException
        Read an object from the ObjectInputStream.

        This implementation differs from the default one by initiating state validation of the object created.

        Parameters:
        inputStream - data stream to read objects from
        Throws:
        java.lang.ClassNotFoundException - if instantiating a class fails
        java.io.IOException - if reading from the stream fails