(no commit message)
[cdmlib.git] / cdmlib-persistence / src / main / java / eu / etaxonomy / cdm / database / types / PostgreSQLDatabaseType.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 eu.etaxonomy.cdm.database.ICdmDataSource;
13
14
15 /**
16 * @author a.mueller
17 *
18 */
19 public class PostgreSQLDatabaseType extends DatabaseTypeBase {
20
21 //typeName
22 protected String typeName = "PostgreSQL";
23 //class
24 protected String classString = "org.postgresql.Driver";
25 //url
26 protected String urlString = "jdbc:postgresql://";
27 //port
28 private int defaultPort = 5432;
29 //hibernate dialect
30 private String hibernateDialect = "PostgreSQLDialect";
31
32
33 //connection String
34 public String getConnectionString(ICdmDataSource ds, int port){
35 return urlString + ds.getServer() + ":" + port + "/" + ds.getDatabase();
36 }
37
38 public PostgreSQLDatabaseType() {
39 init (typeName, classString, urlString, defaultPort, hibernateDialect );
40 }
41
42
43
44
45 }