5 <li>ADO.NET Data Provider for <a href="http://www.oracle.com/">Oracle</a> databases</li>
7 <li>Exists in namespace System.Data.OracleClient and assembly System.Data.OracleClient</li>
9 <li>Works on Windows and Linux</li>
11 <li>Works with Oracle 8i</li>
13 <li>Uses the Oracle CLI (Call Level Interface) which is a C library (API) for the Oracle Client
16 <li>Internally, the OracleClient provider has OCI abstracted to an object-oriented programming model</li>
18 <li>Created by Daniel Morgan and Tim Coleman</li>
20 <li>Does not support trusted connections</li>
22 <li>Bugs with Mono or the data provider should be reported
23 in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
24 do not have Bugzilla user account, it is free
26 create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
33 <li>OracleConnection can connect and disconnect to an Oracle 8i database on
34 Windows and Linux via OCI (Oracle Call-level Interface)</li>
36 <li>No longer uses a glue library (a library between the System.Data.OracleClient.dll
37 assembly and the oci library). In Current Mono cvs, System.Data.OracleClient
38 directly platform invokes into the oci library thanks to Tim Coleman.</li>
40 <li>Can have multiple connections with different transactions where each transaction is
41 separated from the others, so a rollback or commit in one transaction
42 does not affect the other.</li>
44 <li>Can execute simple DML SQL statements, such as,
45 INSERT a row into the EMP table via the OracleCommand's ExecuteNonQuery method</li>
47 <li>The System.Data.OracleClient.dll assembly can be built with mcs/mono via
48 the makefile.gnu for System.Data.OracleClient or csc/.net via the
49 System.Data.OracleClient.build nant build file.</li>
51 <li>Can retrieve data via ExecuteReader and OracleDataReader. Currently,
53 data is supported. ExecuteScalar() still needs to be imlemented.</li>
55 <li>OracleException and Error handling exists now.</li>
57 <li>Handling of various data types need to be handled</li>
59 <li>Data Adapter needs to be created. Tim has started on it.</li>
61 <li>Lots of missing functionality and bugs.</li>
63 <li>Works with SQL# command-line and GTK# versions in cvs. Only works with
64 simple character data though. SQL# For GTK# can only show the results to
65 the TextView because the Data Adapter is not yet available</li>
72 <li>Be able to retrieve results via a data reader</li>
73 <li>Parameters support</li>
75 <li>Stored Procedures, Functions, and Packages support</li>
76 <li>Be able to fill a DataTable in a DataSet via a data adapter</li>
77 <li>Support for Oracle 8i and 9i</li>
79 <li>Support all the data types</li>
80 <li>Implement Connection pooling</li>
85 ** Testing System.Data.OracleClient
88 <li>Have a working mono and mcs</li>
90 <li>Have access to an Oracle 8i database or download it from
91 <a href="http://www.oracle.com/">Oracle</a>. If you are connecting
92 remotely to an Oracle database, you need the Oracle client software.
93 Registration to the Oracle Technology Network is free. If installing on Linux,
94 I suggest you do a lot of searching to see how others installed Oracle on Linux.</li>
96 <li>Make sure System.Data.OracleClient.dll assembly is built, if not, go
97 into System.Data.OracleClient and do a make -f makefile.gnu (on Linux) or
98 ../../nant/NAnt.exe (on Windows using Cygwin).</li>
100 <li>Take a look at TestOracleClient.cs found at mcs/class/System.Data.OracleClient/Test</li>
102 <li>The Data Source is an Oracle TNSNAME</li>
104 <li>Has a connection string format:
106 "Data Source=tnsname;User ID=userid;Password=password"
113 using System.Data.OracleClient;
117 public static void Main(string[] args)
119 string connectionString =
120 "Data Source=testdb;" +
124 dbcon = new OracleConnection(connectionString);
126 IDbCommand dbcmd = dbcon.CreateCommand();
127 string sql = "SELECT ename, job FROM scott.emp";
128 dbcmd.CommandText = sql;
129 IDataReader reader = dbcmd.ExecuteReader();
130 while(reader.Read()) {
131 string employeeName = reader["ename"];
132 string job = reader["job"];
133 Console.WriteLine("Employee Name: {0} Job: {1}",
139 dbcmd.CommandText = sql;
140 dbcmd.ExecuteNonQuery();
149 <li>Building C# Example:
151 <li>Save the example to a file, such as, TestExample.cs</li>
154 mcs TestExample.cs -r System.Data.dll \
155 -r System.Data.OracleClient.dll
158 <li>Build on Windows via Cygwin:
160 mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \
162 -lib:C:/cygwin/home/MyHome/mono/install/lib \
163 -r System.Data.dll -r System.Data.OracleClient.dll
168 <li>Running the Example: