2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.cdm
.database
;
12 import java
.sql
.ResultSet
;
14 import org
.hibernate
.cache
.CacheProvider
;
15 import org
.springframework
.beans
.factory
.config
.BeanDefinition
;
17 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalCode
;
19 public interface ICdmDataSource
{
22 * Returns a BeanDefinition object of type DataSource that contains
23 * datsource properties (url, username, password, ...)
24 * @return BeanDefinition
26 public BeanDefinition
getDatasourceBean();
30 * @return BeanDefinition
32 public BeanDefinition
getHibernatePropertiesBean(DbSchemaValidation hbm2dll
);
38 * @param cacheProviderClass
39 * @return BeanDefinition
41 public BeanDefinition
getHibernatePropertiesBean(DbSchemaValidation hbm2dll
, Boolean showSql
, Boolean formatSql
, Boolean registerSearchListener
, Class
<?
extends CacheProvider
> cacheProviderClass
);
45 * The name representation of thie Datasource.
48 public String
getName();
54 public String
getServer();
59 public String
getDatabase();
61 public DatabaseTypeEnum
getDatabaseType();
71 public String
getFilePath();
76 public H2Mode
getMode();
79 * Tests, if a database connection can be established.
80 * @return true if test was successful, false otherwise
83 public boolean testConnection() throws DataSourceNotFoundException
;
85 public String
getUsername();
87 public String
getPassword();
90 * Executes a query and returns the ResultSet.
91 * @return ResultSet for the query.
93 public ResultSet
executeQuery (String query
);
99 public int executeUpdate (String sqlUpdate
);
101 public NomenclaturalCode
getNomenclaturalCode();
104 // public void setFilePath(String filePath);
106 // public void setMode(H2Mode mode);