DbConnectionBase.cs 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. //
  2. // System.Data.ProviderBase.DbConnectionBase
  3. //
  4. // Author:
  5. // Tim Coleman ([email protected])
  6. //
  7. // Copyright (C) Tim Coleman, 2003
  8. //
  9. //
  10. // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
  11. //
  12. // Permission is hereby granted, free of charge, to any person obtaining
  13. // a copy of this software and associated documentation files (the
  14. // "Software"), to deal in the Software without restriction, including
  15. // without limitation the rights to use, copy, modify, merge, publish,
  16. // distribute, sublicense, and/or sell copies of the Software, and to
  17. // permit persons to whom the Software is furnished to do so, subject to
  18. // the following conditions:
  19. //
  20. // The above copyright notice and this permission notice shall be
  21. // included in all copies or substantial portions of the Software.
  22. //
  23. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  24. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  25. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  26. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  27. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  28. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  29. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  30. //
  31. #if NET_2_0
  32. using System.Data.Common;
  33. using System.EnterpriseServices;
  34. namespace System.Data.ProviderBase {
  35. public abstract class DbConnectionBase : DbConnection
  36. {
  37. #region Fields
  38. DbConnectionFactory connectionFactory;
  39. DbConnectionString connectionOptions;
  40. string connectionString;
  41. #endregion // Fields
  42. #region Constructors
  43. protected DbConnectionBase (DbConnectionBase connection)
  44. : this (connection.ConnectionFactory)
  45. {
  46. }
  47. protected DbConnectionBase (DbConnectionFactory connectionFactory)
  48. {
  49. this.connectionFactory = connectionFactory;
  50. }
  51. #endregion // Constructors
  52. #region Properties
  53. [MonoTODO]
  54. protected int CloseCount {
  55. get { throw new NotImplementedException (); }
  56. }
  57. protected internal DbConnectionFactory ConnectionFactory {
  58. get { return connectionFactory; }
  59. }
  60. protected internal DbConnectionString ConnectionOptions {
  61. get { return connectionOptions; }
  62. }
  63. [MonoTODO]
  64. public override string ConnectionString {
  65. get { return connectionString; }
  66. set {
  67. connectionOptions = ConnectionFactory.CreateConnectionOptionsInternal (value);
  68. connectionString = value;
  69. }
  70. }
  71. [MonoTODO]
  72. public override int ConnectionTimeout {
  73. get { throw new NotImplementedException (); }
  74. }
  75. [MonoTODO]
  76. protected virtual int ConnectionTimeoutInternal {
  77. get { throw new NotImplementedException (); }
  78. }
  79. [MonoTODO]
  80. public override string Database {
  81. get { throw new NotImplementedException (); }
  82. }
  83. [MonoTODO]
  84. public override string DataSource {
  85. get { throw new NotImplementedException (); }
  86. }
  87. [MonoTODO]
  88. protected internal DbConnectionInternal InnerConnection {
  89. get { throw new NotImplementedException (); }
  90. }
  91. [MonoTODO]
  92. public override string ServerVersion {
  93. get { throw new NotImplementedException (); }
  94. }
  95. [MonoTODO]
  96. public override ConnectionState State {
  97. get { throw new NotImplementedException (); }
  98. }
  99. #endregion // Properties
  100. #region Events
  101. public event StateChangeEventHandler StateChange;
  102. #endregion // Events
  103. #region Methods
  104. [MonoTODO]
  105. protected override DbTransaction BeginDbTransaction (IsolationLevel isolationLevel)
  106. {
  107. throw new NotImplementedException ();
  108. }
  109. [MonoTODO]
  110. public override void ChangeDatabase (string value)
  111. {
  112. throw new NotImplementedException ();
  113. }
  114. [MonoTODO]
  115. public override void Close ()
  116. {
  117. throw new NotImplementedException ();
  118. }
  119. protected override DbCommand CreateDbCommand ()
  120. {
  121. return (DbCommand) ConnectionFactory.ProviderFactory.CreateCommand ();
  122. }
  123. [MonoTODO]
  124. protected override void Dispose (bool disposing)
  125. {
  126. throw new NotImplementedException ();
  127. }
  128. [MonoTODO]
  129. public override void EnlistDistributedTransaction (ITransaction transaction)
  130. {
  131. throw new NotImplementedException ();
  132. }
  133. [MonoTODO]
  134. protected virtual DbMetaDataFactory GetMetaDataFactory (DbConnectionInternal internalConnection)
  135. {
  136. throw new NotImplementedException ();
  137. }
  138. [MonoTODO]
  139. protected void OnStateChange (ConnectionState originalState, ConnectionState currentState)
  140. {
  141. throw new NotImplementedException ();
  142. }
  143. [MonoTODO]
  144. public override void Open ()
  145. {
  146. throw new NotImplementedException ();
  147. }
  148. #endregion // Methods
  149. }
  150. }
  151. #endif