[6134] | 1 | #region License Information
|
---|
| 2 | /* HeuristicLab
|
---|
[9615] | 3 | * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
[6134] | 4 | *
|
---|
| 5 | * This file is part of HeuristicLab.
|
---|
| 6 | *
|
---|
| 7 | * HeuristicLab is free software: you can redistribute it and/or modify
|
---|
| 8 | * it under the terms of the GNU General Public License as published by
|
---|
| 9 | * the Free Software Foundation, either version 3 of the License, or
|
---|
| 10 | * (at your option) any later version.
|
---|
| 11 | *
|
---|
| 12 | * HeuristicLab is distributed in the hope that it will be useful,
|
---|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 15 | * GNU General Public License for more details.
|
---|
| 16 | *
|
---|
| 17 | * You should have received a copy of the GNU General Public License
|
---|
| 18 | * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
|
---|
| 19 | */
|
---|
| 20 | #endregion
|
---|
| 21 |
|
---|
| 22 | using System.Data.Common;
|
---|
| 23 |
|
---|
| 24 | namespace HeuristicLab.DataImporter.DbExplorer.Interfaces {
|
---|
| 25 | public abstract class DbConnectionBase {
|
---|
| 26 | private string databaseName;
|
---|
| 27 | public string DatabaseName {
|
---|
| 28 | get { return this.databaseName; }
|
---|
| 29 | set { this.databaseName = value; }
|
---|
| 30 | }
|
---|
| 31 |
|
---|
| 32 | private string userName;
|
---|
| 33 | public string UserName {
|
---|
| 34 | get { return this.userName; }
|
---|
| 35 | set { this.userName = value; }
|
---|
| 36 | }
|
---|
| 37 |
|
---|
| 38 | private string password;
|
---|
| 39 | public string Password {
|
---|
| 40 | get { return this.password; }
|
---|
| 41 | set { this.password = value; }
|
---|
| 42 | }
|
---|
| 43 |
|
---|
| 44 | protected DbConnectionBase(string databaseName, string userName, string password) {
|
---|
| 45 | this.databaseName = databaseName;
|
---|
| 46 | this.userName = userName;
|
---|
| 47 | this.password = password;
|
---|
| 48 | }
|
---|
| 49 |
|
---|
| 50 | public abstract DbConnection CreateConnection();
|
---|
| 51 | public abstract bool TestConnection();
|
---|
| 52 |
|
---|
| 53 | private string errorMessage;
|
---|
| 54 | public string ErrorMessage {
|
---|
| 55 | get { return this.errorMessage; }
|
---|
| 56 | protected set { this.errorMessage = value; }
|
---|
| 57 | }
|
---|
| 58 | }
|
---|
| 59 | }
|
---|