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>Untested, but should work with Oracle 9i</li>
15 <li>Uses the Oracle CLI (Call Level Interface) which is a C library (API) for the Oracle Client
18 <li>Internally, the OracleClient provider has OCI abstracted to an object-oriented programming model</li>
20 <li>Created by Daniel Morgan and Tim Coleman</li>
22 <li>Does not support trusted connections</li>
24 <li>Bugs with Mono or the data provider should be reported
25 in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
26 do not have Bugzilla user account, it is free
28 create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
35 <li>OracleConnection can connect and disconnect to an Oracle 8i database on
36 Windows and Linux via OCI (Oracle Call-level Interface)</li>
38 <li>No longer uses a glue library (a library between the System.Data.OracleClient.dll
39 assembly and the oci library). In Current Mono cvs, System.Data.OracleClient
40 directly platform invokes into the oci library thanks to Tim Coleman.</li>
42 <li>Can have multiple connections with different transactions where each transaction is
43 separated from the others, so a rollback or commit in one transaction
44 does not affect the other.</li>
46 <li>Can execute simple DML SQL statements, such as,
47 INSERT a row into the EMP table via the OracleCommand's ExecuteNonQuery method</li>
49 <li>The System.Data.OracleClient.dll assembly can be built with mcs/mono via
50 the makefile.gnu for System.Data.OracleClient or csc/.net via the
51 System.Data.OracleClient.build nant build file.</li>
53 <li>Can retrieve data via ExecuteReader and OracleDataReader. Currently,
54 supports character, numeric, some date data types. ExecuteScalar
57 <li>Simple input parameters (character and numeric data) can now
58 be used in SQL queries. Output parameters do not yet work.</li>
60 <li>OracleException and Error handling exists now.</li>
62 <li>Message handling needs to be added for non-critical messages
63 received from Oracle</li>
65 <li>Handling of various data types need to be added.</li>
67 <li>Data Adapter exists, and a DataSet can be filled using it. The
68 Data Adapter is abstract enough that it should work as expected.</li>
70 <li>Lots of missing functionality and bugs.</li>
72 <li>Works with SQL# command-line and GTK# versions in cvs. Only works with
73 simple character data though. SQL# For GTK# can only show the results to
74 the TextView because the Data Adapter is not yet available</li>
81 <li>Be able to retrieve results via a data reader (WORKING)</li>
82 <li>Parameters support (IN PROGRESS)</li>
83 <li>transactions (WORKING)</li>
84 <li>Stored Procedures, Functions, and Packages support</li>
85 <li>Be able to fill a DataTable in a DataSet via a data adapter (IN PROGRESS)</li>
86 <li>Support for Oracle 8i and 9i (UNKNOWN)</li>
88 <li>Support all the data types</li>
89 <li>Implement Connection pooling</li>
94 ** Testing System.Data.OracleClient
97 <li>Have a working mono and mcs</li>
99 <li>Have access to an Oracle 8i database or download it from
100 <a href="http://www.oracle.com/">Oracle</a>. If you are connecting
101 remotely to an Oracle database, you need the Oracle client software.
102 Registration to the <a href="http://technet.oracle.com/">Oracle Technology Network</a> is free. If installing on Linux,
103 I suggest you do a lot of searching to see how others installed Oracle on Linux.</li>
105 <li>Make sure System.Data.OracleClient.dll assembly is built, if not, go
106 into System.Data.OracleClient and do a make -f makefile.gnu (on Linux) or
107 ../../nant/NAnt.exe (on Windows using Cygwin).</li>
109 <li>Take a look at TestOracleClient.cs found at mcs/class/System.Data.OracleClient/Test</li>
111 <li>The Data Source is an Oracle TNSNAME</li>
113 <li>Has a connection string format:
115 "Data Source=tnsname;User ID=userid;Password=password"
122 using System.Data.OracleClient;
126 public static void Main (string[] args)
128 string connectionString =
129 "Data Source=testdb;" +
133 dbcon = new OracleConnection (connectionString);
135 IDbCommand dbcmd = dbcon.CreateCommand ();
136 string sql = "SELECT ename, job FROM scott.emp";
137 dbcmd.CommandText = sql;
138 IDataReader reader = dbcmd.ExecuteReader ();
139 while (reader.Read ()) {
140 string employeeName = reader["ename"];
141 string job = reader["job"];
142 Console.WriteLine ("Employee Name: {0} Job: {1}",
148 dbcmd.CommandText = sql;
149 dbcmd.ExecuteNonQuery ();
158 <li>Building C# Example:
160 <li>Save the example to a file, such as, TestExample.cs</li>
163 mcs TestExample.cs -r System.Data.dll \
164 -r System.Data.OracleClient.dll
167 <li>Build on Windows via Cygwin:
169 mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \
171 -lib:C:/cygwin/home/MyHome/mono/install/lib \
172 -r System.Data.dll -r System.Data.OracleClient.dll
177 <li>Running the Example: