Java 类org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl 实例源码

项目:HibernateDemos    文件:SimpleMultiTenantConnectionProvider.java   
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;
}
项目:hibernate-demos    文件:SimpleMultiTenantConnectionProvider.java   
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;
}