2004-02-23 Sebastien Pouliot <sebastien@ximian.com>
[mono.git] / doc / firebird
1 * Firebird and Interbase Data Provider
2
3 <ul>
4         <li>ADO.NET Data Provider for Firebird and Interbase databases</li>
5
6         <li>Does not exist in Mono, but is a separate project</li>
7         
8         <li>The <a href="http://firebird.sourceforge.net/index.php">Firebird Relational Database</a> is 
9         is an independent project which uses source code based on the Interbase source code released
10         by Borland under the Interbase Public License</li>
11         
12         <li>Both the Firebird Relational Database and the Firebird .NET Data Provider can be
13         downloaded from <a href="http://sourceforge.net/projects/firebird/">here</a></li>
14         
15         <li>The Firebird .NET Data provider has been made
16     available by Carlos Guzmán Álvarez (aka "Carlos G.A."), who has also made a
17     number of contributions to the OdbcJdbc code</li>
18
19         <li>Bugs with Mono or the data provider should be reported 
20         in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>.  If you
21         do not have Bugzilla user account, it is free 
22         and easy to create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
23         
24 </ul>
25
26 ** Current Status
27
28 <ul>  
29         <li>Current stable version: 1.5</li>
30         
31         <li>Current developement version: 1.6</li>
32         
33         <li>The new data provider/driver is written in C# and provides a high-performance native
34         implementation of the GDS32/API functions. This means that .Net developers
35         will be able to access Firebird databases without the need of Firebird
36         client install</li>
37  
38     <li>In support of the new module, a new mailing list
39         <a href="http://lists.sourceforge.net/lists/listinfo/firebird-net-provider">firebird-net-provider</a> has 
40         been created. Please use this list for any 
41         questions that you may have about the provider</li>           
42 </ul>   
43
44 ** New features & enhancements in 1.6 version
45
46 <ul>
47         <li>Firebird Embedded Server support.</li>
48         <li>New FbScript class implementation.</li>
49 </ul>
50    
51 ** Testing
52
53 <ul>
54         
55         <li>Need a working mono and mcs</li>
56         
57         <li>Need access to a Firebird Relational Database or you can download
58         it from <a href="http://firebird.sourceforge.net">here</a></li>
59         
60         <li>Get the Firebird .NET data provider from here as 
61         <a href="http://lists.sourceforge.net/lists/listinfo/firebird-net-provider">firebird-net-provider</a>.  Make
62         sure the Firebird .NET data provider binary assembly FirebirdSql.Data.Firebird.dll is
63         installed in the same place as the mono class libraries.</li>
64         
65         <li>Has a ConnectionString format:
66 <pre>
67  "Database=databasefile.gdb;User=user;Password=pass;Dialect=3;Server=hostname"
68 </pre>
69         
70         </li>
71         
72         <li>C# Example:
73         
74 <pre>
75  using System;
76  using System.Data;
77  using FirebirdSql.Data.Firebird;
78  
79  public class Test 
80  {
81     public static void Main(string[] args)
82     {
83         string connectionString = 
84                "Database=C:\\PROGRAM FILES\\FIREBIRD\\EXAMPLES\\EMPLOYEE.GDB;" +
85                "User=SYSDBA;" +
86                "Password=masterkey;" +
87                "Dialect=3;" +
88                "Server=localhost";
89                
90        IDbConnection dbcon = new FbConnection(connectionString);
91        dbcon.Open();
92        IDbCommand dbcmd = dbcon.CreateCommand();
93        string sql = "SELECT * FROM employee";
94        dbcmd.CommandText = sql;
95        IDataReader reader = dbcmd.ExecuteReader();
96        while(reader.Read()) {
97             object dataValue = reader.GetValue(0);
98             string sValue = dataValue.ToString();
99             Console.WriteLine("Value: " + sValue);
100        }
101        // clean up
102        reader.Close();
103        reader = null;
104        dbcmd.Dispose();
105        dbcmd = null;
106        dbcon.Close();
107        dbcon = null;
108     }
109  }
110 </pre>
111         </li>
112         <li>Building C# Example:
113         <ul>
114                 <li>Save the example to a file, such as, TestExample.cs</li>
115                 <li>Build on Linux:
116 <pre>
117         mcs TestExample.cs -r System.Data.dll \
118             -r FirebirdSql.Data.Firebird.dll
119 </pre>
120                 </li>
121                 <li>Build on Windows via Cygwin:
122 <pre>
123         mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \
124              TestExample.cs \
125              -lib:C:/cygwin/home/MyHome/mono/install/lib \
126              -r System.Data.dll -r FirebirdSql.Data.Firebird.dll
127 </pre>
128                 </li>
129         </ul>
130         </li>
131         <li>Running the Example:
132 <pre>
133 mono TestExample.exe
134 </pre>
135 </li>
136
137 </ul>
138