**** Merged from MCS ****
[mono-project.git] / mcs / class / System.Data / System.Data.ProviderBase / DbConnectionBase.cs
blobcb3e83afcf3f666f6be3ec4060b33b19009a1334
1 //
2 // System.Data.ProviderBase.DbConnectionBase
3 //
4 // Author:
5 // Tim Coleman (tim@timcoleman.com)
6 //
7 // Copyright (C) Tim Coleman, 2003
8 //
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:
20 //
21 // The above copyright notice and this permission notice shall be
22 // included in all copies or substantial portions of the Software.
23 //
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.
33 #if NET_2_0
35 using System.Data.Common;
36 using System.EnterpriseServices;
38 namespace System.Data.ProviderBase {
39 public abstract class DbConnectionBase : DbConnection
41 #region Fields
43 DbConnectionFactory connectionFactory;
44 DbConnectionString connectionOptions;
45 string connectionString;
47 #endregion // Fields
49 #region Constructors
51 protected DbConnectionBase (DbConnectionBase connection)
52 : this (connection.ConnectionFactory)
56 protected DbConnectionBase (DbConnectionFactory connectionFactory)
58 this.connectionFactory = connectionFactory;
61 #endregion // Constructors
63 #region Properties
65 [MonoTODO]
66 protected int CloseCount {
67 get { throw new NotImplementedException (); }
70 protected internal DbConnectionFactory ConnectionFactory {
71 get { return connectionFactory; }
74 protected internal DbConnectionString ConnectionOptions {
75 get { return connectionOptions; }
78 [MonoTODO]
79 public override string ConnectionString {
80 get { return connectionString; }
81 set {
82 connectionOptions = ConnectionFactory.CreateConnectionOptionsInternal (value);
83 connectionString = value;
87 [MonoTODO]
88 public override int ConnectionTimeout {
89 get { throw new NotImplementedException (); }
92 [MonoTODO]
93 protected virtual int ConnectionTimeoutInternal {
94 get { throw new NotImplementedException (); }
97 [MonoTODO]
98 public override string Database {
99 get { throw new NotImplementedException (); }
102 [MonoTODO]
103 public override string DataSource {
104 get { throw new NotImplementedException (); }
107 [MonoTODO]
108 protected internal DbConnectionInternal InnerConnection {
109 get { throw new NotImplementedException (); }
112 [MonoTODO]
113 public override string ServerVersion {
114 get { throw new NotImplementedException (); }
117 [MonoTODO]
118 public override ConnectionState State {
119 get { throw new NotImplementedException (); }
122 #endregion // Properties
124 #region Events
126 public event StateChangeEventHandler StateChange;
128 #endregion // Events
130 #region Methods
132 [MonoTODO]
133 protected override DbTransaction BeginDbTransaction (IsolationLevel isolationLevel)
135 throw new NotImplementedException ();
138 [MonoTODO]
139 public override void ChangeDatabase (string value)
141 throw new NotImplementedException ();
144 [MonoTODO]
145 public override void Close ()
147 throw new NotImplementedException ();
150 protected override DbCommand CreateDbCommand ()
152 return (DbCommand) ConnectionFactory.ProviderFactory.CreateCommand ();
155 [MonoTODO]
156 protected override void Dispose (bool disposing)
158 throw new NotImplementedException ();
161 [MonoTODO]
162 public override void EnlistDistributedTransaction (ITransaction transaction)
164 throw new NotImplementedException ();
167 [MonoTODO]
168 protected virtual DbMetaDataFactory GetMetaDataFactory (DbConnectionInternal internalConnection)
170 throw new NotImplementedException ();
173 [MonoTODO]
174 protected void OnStateChange (ConnectionState originalState, ConnectionState currentState)
176 throw new NotImplementedException ();
179 [MonoTODO]
180 public override void Open ()
182 throw new NotImplementedException ();
185 #endregion // Methods
189 #endif