1
|
/**
|
2
|
* Copyright (C) 2007 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
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.
|
8
|
*/
|
9
|
|
10
|
package eu.etaxonomy.cdm.database.types;
|
11
|
|
12
|
import org.springframework.jdbc.datasource.DriverManagerDataSource;
|
13
|
|
14
|
import eu.etaxonomy.cdm.database.ICdmDataSource;
|
15
|
import eu.etaxonomy.cdm.database.LocalHsqldb;
|
16
|
|
17
|
|
18
|
/**
|
19
|
* @author a.mueller
|
20
|
*
|
21
|
*/
|
22
|
public class HSqlDbDatabaseType extends DatabaseTypeBase {
|
23
|
|
24
|
//typeName
|
25
|
private String typeName = "Hypersonic SQL DB (HSqlDb)";
|
26
|
|
27
|
//class
|
28
|
private String classString = "org.hsqldb.jdbcDriver";
|
29
|
|
30
|
//url
|
31
|
private String urlString = "jdbc:hsqldb:hsql://";
|
32
|
|
33
|
//port
|
34
|
private int defaultPort = 9001;
|
35
|
|
36
|
//hibernate dialect
|
37
|
private String hibernateDialect = "HSQLCorrectedDialect";
|
38
|
|
39
|
//init method
|
40
|
private String initMethod = "init";
|
41
|
|
42
|
//destroy method
|
43
|
private String destroyMethod = "destroy";
|
44
|
|
45
|
//connection String
|
46
|
public String getConnectionString(ICdmDataSource ds, int port){
|
47
|
return urlString + ds.getServer() + ":" + port + "/" + ds.getDatabase();
|
48
|
}
|
49
|
|
50
|
|
51
|
public HSqlDbDatabaseType() {
|
52
|
init (typeName, classString, urlString, defaultPort, hibernateDialect );
|
53
|
}
|
54
|
|
55
|
@Override
|
56
|
public Class<? extends DriverManagerDataSource> getDriverManagerDataSourceClass() {
|
57
|
return LocalHsqldb.class;
|
58
|
}
|
59
|
|
60
|
/* (non-Javadoc)
|
61
|
* @see eu.etaxonomy.cdm.database.types.IDatabaseType#getInitMethod()
|
62
|
*/
|
63
|
@Override
|
64
|
public String getInitMethod() {
|
65
|
return initMethod;
|
66
|
}
|
67
|
|
68
|
|
69
|
/* (non-Javadoc)
|
70
|
* @see eu.etaxonomy.cdm.database.types.IDatabaseType#getDestroyMethod()
|
71
|
*/
|
72
|
@Override
|
73
|
public String getDestroyMethod() {
|
74
|
return destroyMethod;
|
75
|
}
|
76
|
|
77
|
|
78
|
}
|