2 // System.Data.ProviderBase.DbConnectionBase
5 // Tim Coleman (tim@timcoleman.com)
7 // Copyright (C) Tim Coleman, 2003
11 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
13 // Permission is hereby granted, free of charge, to any person obtaining
14 // a copy of this software and associated documentation files (the
15 // "Software"), to deal in the Software without restriction, including
16 // without limitation the rights to use, copy, modify, merge, publish,
17 // distribute, sublicense, and/or sell copies of the Software, and to
18 // permit persons to whom the Software is furnished to do so, subject to
19 // the following conditions:
21 // The above copyright notice and this permission notice shall be
22 // included in all copies or substantial portions of the Software.
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35 using System.Data.Common;
36 using System.EnterpriseServices;
38 namespace System.Data.ProviderBase {
39 public abstract class DbConnectionBase : DbConnection
43 DbConnectionFactory connectionFactory;
44 DbConnectionString connectionOptions;
45 string connectionString;
46 bool disposed = false;
52 protected DbConnectionBase (DbConnectionBase connection)
53 : this (connection.ConnectionFactory)
57 protected DbConnectionBase (DbConnectionFactory connectionFactory)
59 this.connectionFactory = connectionFactory;
62 protected DbConnectionBase ()
67 #endregion // Constructors
72 protected int CloseCount {
73 get { throw new NotImplementedException (); }
76 protected internal DbConnectionFactory ConnectionFactory {
77 get { return connectionFactory; }
80 protected internal DbConnectionString ConnectionOptions {
81 get { return connectionOptions; }
85 public override string ConnectionString {
86 get { return connectionString; }
88 connectionOptions = ConnectionFactory.CreateConnectionOptionsInternal (value);
89 connectionString = value;
94 public override int ConnectionTimeout {
95 get { throw new NotImplementedException (); }
99 protected virtual int ConnectionTimeoutInternal {
100 get { throw new NotImplementedException (); }
104 public override string Database {
105 get { throw new NotImplementedException (); }
109 public override string DataSource {
110 get { throw new NotImplementedException (); }
114 protected internal DbConnectionInternal InnerConnection {
115 get { throw new NotImplementedException (); }
119 public override string ServerVersion {
120 get { throw new NotImplementedException (); }
124 public override ConnectionState State {
125 get { throw new NotImplementedException (); }
128 #endregion // Properties
132 public event StateChangeEventHandler StateChange;
139 protected override DbTransaction BeginDbTransaction (IsolationLevel isolationLevel)
141 throw new NotImplementedException ();
145 public override void ChangeDatabase (string value)
147 throw new NotImplementedException ();
151 public override void Close ()
153 throw new NotImplementedException ();
156 protected override DbCommand CreateDbCommand ()
158 return (DbCommand) ConnectionFactory.ProviderFactory.CreateCommand ();
161 protected override void Dispose (bool disposing)
166 // do necessary clean up
170 base.Dispose (disposing);
176 public override void EnlistDistributedTransaction (ITransaction transaction)
178 throw new NotImplementedException ();
182 public override void EnlistTransaction (ITransaction transaction)
184 throw new NotImplementedException ();
188 protected virtual DbMetaDataFactory GetMetaDataFactory (DbConnectionInternal internalConnection)
190 throw new NotImplementedException ();
194 protected void OnStateChange (ConnectionState originalState, ConnectionState currentState)
196 throw new NotImplementedException ();
200 public override void Open ()
202 throw new NotImplementedException ();
206 public override DataTable GetSchema ()
208 throw new NotImplementedException ();
212 public override DataTable GetSchema (string collectionName)
214 throw new NotImplementedException ();
218 public override DataTable GetSchema (string collectionName, string [] restrictionValues)
220 throw new NotImplementedException ();
223 #endregion // Methods