6297b5b6c0a30740171da57ca5be198cfb1e2d8d
[taxeditor.git] / eu.etaxonomy.taxeditor.cdmlib / src / main / java / eu / etaxonomy / taxeditor / remoting / cache / CdmModelCacherConnectionProvider.java
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 import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
9
10 /**
11 * This is a very preliminary class to get the model cache running. Need to better understand how
12 * the datasource works with hibernate service registry before implementing the correct way.
13 * Or use a running source.
14 * @author a.mueller
15 *
16 */
17 public class CdmModelCacherConnectionProvider extends DatasourceConnectionProviderImpl{
18
19 public CdmModelCacherConnectionProvider() {
20 super();
21 setDataSource(getDataSourcePreliminary());
22 }
23
24 private DataSource getDataSourcePreliminary() {
25 String database = "xyz";
26 String path = "C:\\Users\\a.mueller\\.cdmLibrary\\writableResources\\h2\\LocalH2_" + database;
27 String username = "sa";
28 CdmDataSource dataSource = CdmDataSource.NewH2EmbeddedInstance("cdmTest", username, "", path, NomenclaturalCode.ICNAFP);
29 return dataSource;
30 }
31
32
33
34 }