Oracle® Data Provider for .NET Developer's Guide 11g Release 1 (11.1) Part Number B28375-01 |
|
|
View PDF |
An OracleClientFactory
object allows applications to instantiate ODP.NET classes in a generic way.
Supported Only in ADO.NET 2.0-Compliant ODP.NET
Class Inheritance
System.Object
System.Data.Common.DbProviderFactory
Oracle.DataAccess.Client.OracleClientFactory
Declaration
// C# public sealed class OracleClientFactory : DbProviderFactory
Thread Safety
All public static methods are thread-safe, although instance methods do not guarantee thread safety.
Example
// C# using System; using System.Data; using System.Data.Common; using Oracle.DataAccess.Client; class FactorySample { static void Main() { string constr = "user id=scott;password=tiger;data source=oracle"; DbProviderFactory factory = DbProviderFactories.GetFactory("Oracle.DataAccess.Client"); DbConnection conn = factory.CreateConnection(); try { conn.ConnectionString = constr; conn.Open(); DbCommand cmd = factory.CreateCommand(); cmd.Connection = conn; cmd.CommandText = "select * from emp"; DbDataReader reader = cmd.ExecuteReader(); while (reader.Read()) Console.WriteLine(reader["EMPNO"] + " : " + reader["ENAME"]); } catch (Exception ex) { Console.WriteLine(ex.Message); Console.WriteLine(ex.StackTrace); } } }
Requirements
Namespace: Oracle.DataAccess.Client
Assembly: Oracle.DataAccess.dll
Microsoft .NET Framework Version: 2.0
See Also:
OracleClientFactory
members are listed in the following tables:
OracleClientFactory Public Properties
The OracleClientFactory
public properties are listed in Table 7-1.
Table 7-1 OracleClientFactory Public Properties
Property | Description |
---|---|
|
Indicates whether or not the |
OracleClientFactory Public Methods
OracleClientFactory
Public Methods are listed in Table 7-2.
Table 7-2 OracleClientFactory Public Method
Method | Description |
---|---|
|
Returns a |
|
Returns a |
|
Returns a |
|
Returns a |
|
Returns a |
|
Returns a |
|
Returns a |
Not Supported |
The OracleClientFactory
public properties are listed in Table 7-3.
Table 7-3 OracleClientFactory Public Properties
Property | Description |
---|---|
|
Indicates whether or not the |
See Also:
This property indicates whether or not the CreateDataSourceEnumerator
method is supported.
Declaration
// C# public override bool CanCreateDataSourceEnumerator { get; }
Property Value
Returns true
.
Remarks
ODP.NET supports the OracleDataSourceEnumerator
object.
See Also:
The OracleClientFactory
public method is listed in Table 7-4.
Table 7-4 OracleClientFactory Public Method
Method | Description |
---|---|
|
Returns a |
|
Returns a |
|
Returns a |
|
Returns a |
|
Returns a |
|
Returns a |
|
Returns a |
Not Supported |
See Also:
This method returns a DbCommand
object that represents an OracleCommand
object.
Declaration
// C# public override DbCommand CreateCommand();
Return Value
A DbCommand
object that represents an OracleCommand
object.
See Also:
This method returns a DbCommandBuilder
object that represents an OracleCommandBuilder
object.
Declaration
// C# public override DbCommandBuilder CreateCommandBuilder();
Return Value
A DbCommandBuilder
object that represents an OracleCommandBuilder
object.
See Also:
This method returns a DbConnection
object that represents an OracleConnection
object.
Declaration
// C# public override DbConnection CreateConnection();
Return Value
A DbConnection
object that represents an OracleConnection
object.
See Also:
This method returns a DbConnectionStringBuilder
object that represents an OracleConnectionStringBuilder
object.
Declaration
// C# public override DbConnectionStringBuilder CreateConnectionStringBuilder();
Return Value
A DbConnectionStringBuilder
object that represents an OracleConnectionStringBuilder
object.
See Also:
This method returns a DbDataAdapter
object that represents an OracleDataAdapter
object.
Declaration
// C# public override DbDataAdapter CreateDataAdapter();
Return Value
A DbDataAdapter
object that represents an OracleDataAdapter
object.
See Also:
This method returns a DbDataSourceEnumerator
object that represents an OracleDataSourceEnumerator
object.
Declaration
// C# public override DbDataSourceEnumerator CreateDataSourceEnumerator();
Return Value
A DbDataSourceEnumerator
object that represents an OracleDataSourceEnumerator
object.
See Also:
This method returns a DbParameter
object that represents an OracleParameter
object.
Declaration
// C# public override DbParameter CreateParameter();
Return Value
A DbParameter
object that represents an OracleParameter
object.
See Also:
This method is not supported.
Declaration
// C# public override CodeAccessPermission CreatePermission (PermissionState state );
Exceptions
NotSupportedException
- The method is not supported.
Remarks
This method is not supported.