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 org
.hibernate
.dialect
.Dialect
;
13 import org
.hibernate
.dialect
.SybaseDialect
;
15 import eu
.etaxonomy
.cdm
.database
.ICdmDataSource
;
23 public class SybaseDatabaseType
extends DatabaseTypeBase
{
26 protected String typeName
= "Sybase";
28 protected String classString
= "com.sybase.jdbc2.jdbc.SybDriver";
30 protected String urlString
= "jdbc:sybase:Tds:";
32 private int defaultPort
= 4100;
34 private Dialect hibernateDialect
= new SybaseDialect();
36 private static String dbSeparator
= "/";
39 public String
getConnectionString(ICdmDataSource ds
, int port
){
40 return urlString
+ ds
.getServer()+ ":" + port
+ dbSeparator
+ ds
.getDatabase();
44 * @see eu.etaxonomy.cdm.database.types.DatabaseTypeBase#getServerNameByConnectionString(java.lang.String)
47 public String
getDatabaseNameByConnectionString(String connectionString
){
49 result
= getDatabasePartOfConnectionString(connectionString
, dbSeparator
);
51 // int posParams = result.indexOf("?");
52 // if (posParams != -1){
53 // result = result.substring(0, posParams);
58 public SybaseDatabaseType() {
59 init (typeName
, classString
, urlString
, defaultPort
, hibernateDialect
);