Java Code Examples for org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl#configure()

The following examples show how to use org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl#configure() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
private ConnectionProvider buildConnectionProvider(String dbName) {
	Properties props = new Properties( null );
	props.put( "hibernate.connection.driver_class", DRIVER );
	// Inject dbName into connection url string.
	props.put( "hibernate.connection.url", String.format( URL, dbName ) );
	props.put( "hibernate.connection.username", USER );
	props.put( "hibernate.connection.password", PASS );
	
	// Note that DriverManagerConnectionProviderImpl is an internal class.  However, rather than creating
	// a ConnectionProvider, I'm using it for simplicity's sake.
	// DriverManagerConnectionProviderImpl obtains a Connection through the JDBC Driver#connect
	DriverManagerConnectionProviderImpl connectionProvider = new DriverManagerConnectionProviderImpl();
	connectionProvider.configure( props );
	return connectionProvider;
}
 
Example 2
private ConnectionProvider buildConnectionProvider(String dbName) {
	Properties props = new Properties( null );
	props.put( "hibernate.connection.driver_class", DRIVER );
	// Inject dbName into connection url string.
	props.put( "hibernate.connection.url", String.format( URL, dbName ) );
	props.put( "hibernate.connection.username", USER );
	props.put( "hibernate.connection.password", PASS );
	
	// Note that DriverManagerConnectionProviderImpl is an internal class.  However, rather than creating
	// a ConnectionProvider, I'm using it for simplicity's sake.
	// DriverManagerConnectionProviderImpl obtains a Connection through the JDBC Driver#connect
	DriverManagerConnectionProviderImpl connectionProvider = new DriverManagerConnectionProviderImpl();
	connectionProvider.configure( props );
	return connectionProvider;
}
 
Example 3
private void initConnectionProviderForTenant(String tenantId) throws IOException {
    Properties properties = new Properties();
    properties.load(getClass().getResourceAsStream(String.format("/hibernate-database-%s.properties", tenantId)));
    DriverManagerConnectionProviderImpl connectionProvider = new DriverManagerConnectionProviderImpl();
    connectionProvider.configure(properties);
    this.connectionProviderMap.put(tenantId, connectionProvider);
}
 
Example 4
private ConnectionProvider initConnectionProvider() throws IOException {
    Properties properties = new Properties();
    properties.load(getClass().getResourceAsStream("/hibernate-schema-multitenancy.properties"));

    DriverManagerConnectionProviderImpl connectionProvider = new DriverManagerConnectionProviderImpl();
    connectionProvider.configure(properties);
    return connectionProvider;
}