Class ClientConnectionPoolDataSource

  • All Implemented Interfaces:
    java.io.Serializable, java.sql.Wrapper, javax.naming.Referenceable, javax.sql.CommonDataSource, javax.sql.ConnectionPoolDataSource, javax.sql.DataSource, org.apache.derby.jdbc.ClientConnectionPoolDataSourceInterface, org.apache.derby.jdbc.ClientDataSourceInterface

    public class ClientConnectionPoolDataSource
    extends ClientDataSource
    implements org.apache.derby.jdbc.ClientConnectionPoolDataSourceInterface
    This datasource is suitable for a client/server use of Derby, running on full Java SE 6 and higher, corresponding to JDBC 4.0 and higher.

    ClientConnectionPoolDataSource is a factory for PooledConnection objects. An object that implements this interface will typically be registered with a naming service that is based on the Java Naming and Directory Interface (JNDI).

    See Also:
    Serialized Form
    • 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 org.apache.derby.jdbc.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 org.apache.derby.jdbc.ClientConnectionPoolDataSourceInterface
        Returns:
        Maximum number of statements to cache, or 0 if caching is disabled (default).