Selaa lähdekoodia

Added OracleClientFactory implementation

svn path=/trunk/mcs/; revision=73181
Konstantin Triger 19 vuotta sitten
vanhempi
sitoutus
64ea87db4f

+ 84 - 0
mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleClientFactory.cs

@@ -0,0 +1,84 @@
+//
+// System.Data.OracleClient.OracleClientFactory.cs
+//
+// Author:
+//   Sureshkumar T ([email protected])
+//
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+namespace System.Data.OracleClient
+{
+	using System.Data;
+	using System.Data.Common;
+
+	public sealed class OracleClientFactory : DbProviderFactory
+	{
+		#region Fields
+		public static readonly OracleClientFactory Instance = new OracleClientFactory();
+		#endregion //Fields
+
+		#region Constructors
+
+		private OracleClientFactory () {
+
+		}
+
+		#endregion //Constructors
+
+		[MonoTODO]
+		public override bool CanCreateDataSourceEnumerator {
+			get { throw new NotImplementedException (); }
+		}
+
+		#region public overrides
+		public override DbCommand CreateCommand () {
+			return new OracleCommand ();
+		}
+
+		public override DbCommandBuilder CreateCommandBuilder () {
+			return new OracleCommandBuilder ();
+		}
+
+		public override DbConnection CreateConnection () {
+			return new OracleConnection ();
+		}
+
+		public override DbDataAdapter CreateDataAdapter () {
+			return new OracleDataAdapter ();
+		}
+
+		[MonoTODO]
+		public override DbDataSourceEnumerator CreateDataSourceEnumerator () {
+			throw new NotImplementedException ();
+		}
+
+		public override DbParameter CreateParameter () {
+			return new OracleParameter ();
+		}
+
+		#endregion // public overrides
+	}
+}
+#endif // NET_2_0

+ 2 - 1
mcs/class/System.Data.OracleClient/System.Data.OracleClient20.csproj

@@ -134,6 +134,7 @@
     <Compile Include="System.Data.OracleClient.jvm\OracleParameterCollection.cs" />
     <Compile Include="System.Data.OracleClient.jvm\OracleTransaction.cs" />
     <Compile Include="System.Data.OracleClient.jvm\Regex.cs" />
+    <Compile Include="System.Data.OracleClient\OracleClientFactory.cs" />
     <Compile Include="System.Data.OracleClient\OracleDataAdapter.cs">
       <SubType>Component</SubType>
     </Compile>
@@ -161,4 +162,4 @@
   <ItemGroup>
     <Folder Include="Properties\" />
   </ItemGroup>
-</Project>
+</Project>