Class GenericJdbcConnectionFactory

    • Constructor Detail

      • GenericJdbcConnectionFactory

        public GenericJdbcConnectionFactory​(DatabaseConnectionConfig databaseConnectionConfig,
                                            Map<String,​String> properties,
                                            DatabaseConnectionInfo databaseConnectionInfo,
                                            Map<String,​String> configOptions)
        Parameters:
        databaseConnectionConfig - database connection configuration DatabaseConnectionConfig
        properties - JDBC connection properties.
        databaseConnectionInfo - Contains JDBC driver and default port details.
        configOptions - environment/config options; when fas_token is present, uses direct DriverManager connections.
    • Method Detail

      • getConnectionFromManagedPool

        protected Connection getConnectionFromManagedPool​(CredentialsProvider credentialsProvider)
                                                   throws SQLException
        Returns a connection from the HikariCP connection pool, initializing the pool on first call. Subclasses can call this directly to bypass the useDirectConnection check.
        Parameters:
        credentialsProvider - jdbc user and password provider, or null if no credentials.
        Returns:
        JDBC connection from the pool.
        Throws:
        SQLException - if a connection cannot be obtained.
      • close

        public void close()
        Closes the connection pool, releasing pooled connections and their background threads. The factory stays usable: a later getConnection rebuilds the pool, so closing a handler that is subsequently reused does not permanently break it.
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface JdbcConnectionFactory