Package com.zaxxer.hikari

Examples of com.zaxxer.hikari.HikariDataSource


        dataSource = (DataSource) jndiContext.lookup("java:comp/env/jdbc/hello_world");
      }
      else
      {
        // use faster DataSource impl
        HikariDataSource ds = new HikariDataSource();
        ds.setJdbcUrl("jdbc:mysql://localhost:3306/hello_world?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useUnbufferedInput=false&useReadAheadInput=false&maintainTimeStats=false&useServerPrepStmts&cacheRSMetadata=true");
        ds.setDriverClassName("com.mysql.jdbc.Driver");
        ds.setUsername("benchmarkdbuser");
        ds.setPassword("benchmarkdbpass");
        dataSource = ds;
      }
    } catch (Exception x)
    {
      throw new RuntimeException("Cannot create the data source", x);
View Full Code Here


            HikariConfig config = new HikariConfig();
            config.setDataSourceClassName(propertyResolver.getProperty("dataSourceClassName"));
            config.addDataSourceProperty("url", dbUrl);
            config.addDataSourceProperty("user", username);
            config.addDataSourceProperty("password", password);
            return new HikariDataSource(config);
        } else {
            throw new ApplicationContextException("Heroku database URL is not configured, you must set --spring.datasource.heroku-url=$DATABASE_URL");
        }
    }
View Full Code Here

   public static DataSource createDataSource(Properties properties) throws Exception
   {
      HikariConfig config = new HikariConfig(properties);

      return new HikariDataSource(config);
   }
View Full Code Here

   {
      try {
         LOGGER.debug("Configuring HikariCP");

         this.hcfg = HikariConfigurationUtil.loadConfiguration(props);
         this.hds = new HikariDataSource(this.hcfg);

      }
      catch (Exception e) {
         throw new HibernateException(e);
      }
View Full Code Here

            config.addDataSourceProperty("cachePrepStmts", propertyResolver.getProperty("cachePrepStmts", "true"));
            config.addDataSourceProperty("prepStmtCacheSize", propertyResolver.getProperty("prepStmtCacheSize", "250"));
            config.addDataSourceProperty("prepStmtCacheSqlLimit", propertyResolver.getProperty("prepStmtCacheSqlLimit", "2048"));
            config.addDataSourceProperty("useServerPrepStmts", propertyResolver.getProperty("useServerPrepStmts", "true"));
        }
        return new HikariDataSource(config);
    }
View Full Code Here

  }

  @Provides
  @Singleton
  public DataSource dataSource(HikariConfig config) {
    return new HikariDataSource(config);
  }
View Full Code Here

  public void configure(Map props) throws HibernateException {
    try {
      LOGGER.debug( "Configuring HikariCP" );

      hcfg = HikariConfigurationUtil.loadConfiguration( props );
      hds = new HikariDataSource( hcfg );

    }
    catch (Exception e) {
      throw new HibernateException( e );
    }
View Full Code Here

        }

        config.setInitializationFailFast(true);
        config.setConnectionTestQuery("SELECT 1");

        return new HikariDataSource(config);
    }
View Full Code Here

        config.setPassword("");

        config.setInitializationFailFast(true);
        config.setConnectionTestQuery("SELECT 1");

        return new HikariDataSource(config);

//        return new EmbeddedDatabaseBuilder()
//                .setType(EmbeddedDatabaseType.H2)
//                .build();
    }
View Full Code Here

    config.addDataSourceProperty("serverName", System.getProperty("norm.serverName"));
    config.addDataSourceProperty("databaseName", System.getProperty("norm.databaseName"));
    config.addDataSourceProperty("user", System.getProperty("norm.user"));
    config.addDataSourceProperty("password", System.getProperty("norm.password"));
    config.setInitializationFailFast(true);
    return new HikariDataSource(config);
  }
View Full Code Here

TOP

Related Classes of com.zaxxer.hikari.HikariDataSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.