core/cas-server-core-configuration/src/main/java/org/apereo/cas/configuration/support/Beans.java
/**
     * New hickari data source.
     *
     * @param jpaProperties the jpa properties
     * @return the hikari data source
     */
New hickari data source.
@param jpaProperties the jpa properties
@return the hikari data source
New hickari data source . @param jpaProperties the jpa properties @return the hikari data source
public static HikariDataSource newHickariDataSource(final AbstractJpaProperties jpaProperties) {
        try {
            final HikariDataSource bean = new HikariDataSource();
            bean.setDriverClassName(jpaProperties.getDriverClass());
            bean.setJdbcUrl(jpaProperties.getUrl());
            bean.setUsername(jpaProperties.getUser());
            bean.setPassword(jpaProperties.getPassword());
            bean.setMaximumPoolSize(jpaProperties.getPool().getMaxSize());
            bean.setMinimumIdle(jpaProperties.getPool().getMaxIdleTime());
            bean.setIdleTimeout(jpaProperties.getIdleTimeout());
            bean.setLeakDetectionThreshold(jpaProperties.getLeakThreshold());
            bean.setInitializationFailFast(jpaProperties.isFailFast());
            bean.setIsolateInternalQueries(jpaProperties.isIsolateInternalQueries());
            bean.setConnectionTestQuery(jpaProperties.getHealthQuery());
            bean.setAllowPoolSuspension(jpaProperties.getPool().isSuspension());
            bean.setAutoCommit(jpaProperties.isAutocommit());
            bean.setLoginTimeout(jpaProperties.getPool().getMaxWait());
            bean.setValidationTimeout(jpaProperties.getPool().getMaxWait());
            return bean;
        } catch (final Exception e) {
            throw new IllegalArgumentException(e);
        }
    }
public static HikariDataSource newHickariDataSource ( final AbstractJpaProperties jpaProperties ) { try { final HikariDataSource bean = new HikariDataSource ( ) ; bean . setDriverClassName ( jpaProperties . getDriverClass ( ) ) ; bean . setJdbcUrl ( jpaProperties . getUrl ( ) ) ; bean . setUsername ( jpaProperties . getUser ( ) ) ; bean . setPassword ( jpaProperties . getPassword ( ) ) ; bean . setMaximumPoolSize ( jpaProperties . getPool ( ) . getMaxSize ( ) ) ; bean . setMinimumIdle ( jpaProperties . getPool ( ) . getMaxIdleTime ( ) ) ; bean . setIdleTimeout ( jpaProperties . getIdleTimeout ( ) ) ; bean . setLeakDetectionThreshold ( jpaProperties . getLeakThreshold ( ) ) ; bean . setInitializationFailFast ( jpaProperties . isFailFast ( ) ) ; bean . setIsolateInternalQueries ( jpaProperties . isIsolateInternalQueries ( ) ) ; bean . setConnectionTestQuery ( jpaProperties . getHealthQuery ( ) ) ; bean . setAllowPoolSuspension ( jpaProperties . getPool ( ) . isSuspension ( ) ) ; bean . setAutoCommit ( jpaProperties . isAutocommit ( ) ) ; bean . setLoginTimeout ( jpaProperties . getPool ( ) . getMaxWait ( ) ) ; bean . setValidationTimeout ( jpaProperties . getPool ( ) . getMaxWait ( ) ) ; return bean ; } catch ( final Exception e ) { throw new IllegalArgumentException ( e ) ; } }
New hickari data source.
New hickari data source .