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
;
12 import java
.sql
.Connection
;
13 import java
.sql
.DriverManager
;
15 import org
.apache
.log4j
.Logger
;
17 import eu
.etaxonomy
.cdm
.database
.types
.IDatabaseType
;
24 abstract class CdmDataSourceBase
implements ICdmDataSource
{
25 private static final Logger logger
= Logger
.getLogger(CdmDataSourceBase
.class);
30 * @see eu.etaxonomy.cdm.database.ICdmDataSource#testConnection()
32 public boolean testConnection() {
34 IDatabaseType dbType
= getDatabaseType().getDatabaseType();
35 String classString
= dbType
.getClassString();
36 Class
.forName(classString
);
38 String mUrl
= dbType
.getConnectionString(this);
39 Connection mConn
= DriverManager
.getConnection(mUrl
, getUsername(), getPassword());
45 } catch (Exception e
) {
46 logger
.warn(e
.getMessage());