All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rs.data.hibernate.util.DataSourceConnectionProvider Maven / Gradle / Ivy

There is a newer version: 2.0.2
Show newest version
package rs.data.hibernate.util;

import javax.sql.DataSource;

import org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider;

/**
 * Inject the data source
 * @author ralph
 *
 */
public class DataSourceConnectionProvider extends InjectedDataSourceConnectionProvider {

	private static DataSource myDatasource;
	
	/**
	 * Constructor.
	 */
	public DataSourceConnectionProvider() {
	}

	
	/**
	 * {@inheritDoc}
	 */
	@Override
	public DataSource getDataSource() {
		return getMyDatasource();
	}


	/**
	 * Returns the myDatasource.
	 * @return the myDatasource
	 */
	public static DataSource getMyDatasource() {
		return myDatasource;
	}

	/**
	 * Sets the myDatasource.
	 * @param myDatasource the myDatasource to set
	 */
	public static void setMyDatasource(DataSource myDatasource) {
		DataSourceConnectionProvider.myDatasource = myDatasource;
	}

	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy