(no commit message)
[cdmlib.git] / cdmlib-persistence / src / main / java / eu / etaxonomy / cdm / database / types / IDatabaseType.java
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 public interface IDatabaseType {
15 /**
16 * @return
17 */
18 public String getName();
19 /**
20 * @return
21 */
22 public String getClassString();
23 /**
24 * @return
25 */
26 public String getUrlString();
27 /**
28 * @return
29 */
30 public int getDefaultPort();
31
32 /**
33 * @return
34 */
35 public String getHibernateDialect();
36
37 /**
38 * Returns the connection String for the given parameters
39 * @param server the server, e.g. IP-Address
40 * @param database the database name on the server (e.g. "testDB")
41 * @param port the port number
42 * @return the connection String
43 */
44 public String getConnectionString(String server, String database, int port);
45
46 /**
47 * Returns the connection String for the given parameters, using default port
48 * @param server the server, e.g. IP-Address
49 * @param database the database name on the server (e.g. "testDB")
50 * @return the connection String
51 */
52 public String getConnectionString(String server, String database);
53
54 /**
55 * Returns the DriverManagerDataSource class that that the datasource needs to create a spring bean
56 * @return the DriverManagerDataSource class
57 */
58 public Class<? extends DriverManagerDataSource> getDriverManagerDataSourceClass();
59
60 }