Project

General

Profile

Download (1007 Bytes) Statistics
| Branch: | Tag: | Revision:
1
package eu.etaxonomy.taxeditor.remoting.cache;
2

    
3
import javax.sql.DataSource;
4

    
5
import org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl;
6

    
7
import eu.etaxonomy.cdm.database.CdmDataSource;
8

    
9
/**
10
 * This is a very preliminary class to get the model cache running. Need to better understand how 
11
 * the datasource works with hibernate service registry before implementing the correct way.
12
 * Or use a running source.
13
 * @author a.mueller
14
 *
15
 */
16
public class CdmModelCacherConnectionProvider extends DatasourceConnectionProviderImpl{
17

    
18
	public CdmModelCacherConnectionProvider() {
19
		super();
20
		setDataSource(getDataSourcePreliminary());
21
	}
22

    
23
	private DataSource getDataSourcePreliminary() {
24
		String database = "xyz";
25
		String path = "C:\\Users\\a.mueller\\.cdmLibrary\\writableResources\\h2\\LocalH2_" + database;
26
        String username = "sa";
27
        CdmDataSource dataSource = CdmDataSource.NewH2EmbeddedInstance("cdmTest", username, "", path);
28
        return dataSource;
29
	}
30
	
31
	
32

    
33
}
(5-5/10)