com.googlecode.jdbw
Interface DataSourceFactory

All Known Implementing Classes:
OneSharedConnectionDataSource.Factory

public interface DataSourceFactory

This interface is used by a DatabaseServer to construct a DataSource from its configuration. Implementations of this class will typically use the configuration (jdbc url and extra properties) in combination with a third-party database connection pool library to instantiate a DataSource object. The implementation must also provide a way to close this data source.

Author:
Martin Berglund

Method Summary
 void close(DataSource previouslyConstructedDataSource)
          Closes a DataSource previously created by newDataSource on this object.
 DataSource newDataSource(String jdbcUrl, Properties properties)
          Creates a new DataSource using supplied connection configuration
 

Method Detail

newDataSource

DataSource newDataSource(String jdbcUrl,
                         Properties properties)
Creates a new DataSource using supplied connection configuration

Parameters:
jdbcUrl - JDBC url to connect to
properties - Extra connection properties (should contain username and password, at least)
Returns:
DataSource implementation created from the supplied configuration

close

void close(DataSource previouslyConstructedDataSource)
Closes a DataSource previously created by newDataSource on this object.

Parameters:
previouslyConstructedDataSource - Data source to close


Copyright © 2012. All Rights Reserved.