List of usage examples for org.hibernate.internal.util.config ConfigurationHelper getBoolean
public static boolean getBoolean(String name, Map values)
From source file:com.jolbox.bonecp.provider.BoneCPConnectionProvider.java
License:Apache License
/** * Pool configuration./*w w w . j a v a2 s . co m*/ * @param props * @throws HibernateException */ public void configure(Properties props) throws HibernateException { try { this.config = new BoneCPConfig(props); // old hibernate config String url = props.getProperty(CONFIG_CONNECTION_URL); String username = props.getProperty(CONFIG_CONNECTION_USERNAME); String password = props.getProperty(CONFIG_CONNECTION_PASSWORD); String driver = props.getProperty(CONFIG_CONNECTION_DRIVER_CLASS); if (url == null) { url = props.getProperty(CONFIG_CONNECTION_URL_ALTERNATE); } if (username == null) { username = props.getProperty(CONFIG_CONNECTION_USERNAME_ALTERNATE); } if (password == null) { password = props.getProperty(CONFIG_CONNECTION_PASSWORD_ALTERNATE); } if (driver == null) { driver = props.getProperty(CONFIG_CONNECTION_DRIVER_CLASS_ALTERNATE); } if (url != null) { this.config.setJdbcUrl(url); } if (username != null) { this.config.setUsername(username); } if (password != null) { this.config.setPassword(password); } // Remember Isolation level this.isolation = ConfigurationHelper.getInteger(AvailableSettings.ISOLATION, props); this.autocommit = ConfigurationHelper.getBoolean(AvailableSettings.AUTOCOMMIT, props); logger.debug(this.config.toString()); if (driver != null && !driver.trim().equals("")) { loadClass(driver); } if (this.config.getConnectionHookClassName() != null) { Object hookClass = loadClass(this.config.getConnectionHookClassName()).newInstance(); this.config.setConnectionHook((ConnectionHook) hookClass); } // create the connection pool this.pool = createPool(this.config); } catch (Exception e) { throw new HibernateException(e); } }