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
.types
;
12 import eu
.etaxonomy
.cdm
.database
.ICdmDataSource
;
17 * Db2 in use with Universal Driver (db2jcc.jar)
22 public class Db2DatabaseType
extends DatabaseTypeBase
{
25 protected String typeName
= "DB2 Universal";
27 protected String classString
= "com.ibm.db2.jcc.DB2Driver";
28 //protected String classString = "COM.ibm.db2.jdbc.app.DB2Driver";
29 //protected String classString = "COM.ibm.db2.jdbc.net.DB2Driver";
32 protected String urlString
= "jdbc:db2://";
34 private int defaultPort
= 50000;
36 private String hibernateDialect
= "DB2Dialect";
38 private static String dbSeparator
= "/";
41 public String
getConnectionString(ICdmDataSource ds
, int port
){
43 return urlString
+ ds
.getServer() + ":" + port
+ dbSeparator
+ ds
.getDatabase();
47 * @see eu.etaxonomy.cdm.database.types.DatabaseTypeBase#getServerNameByConnectionString(java.lang.String)
49 public String
getDatabaseNameByConnectionString(String connectionString
){
51 result
= getDatabasePartOfConnectionString(connectionString
,dbSeparator
);
53 // int posParams = result.indexOf("?");
54 // if (posParams != -1){
55 // result = result.substring(0, posParams);
60 public Db2DatabaseType() {
61 init (typeName
, classString
, urlString
, defaultPort
, hibernateDialect
);