1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
//
// System.Data.OleDb.libgda
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
//
// Copyright (C) Rodrigo Moya, 2002
//
using System.Data;
using System.Data.Common;
using System.Runtime.InteropServices;
namespace System.Data.OleDb
{
sealed internal class libgda
{
private static IntPtr m_gdaClient = IntPtr.Zero;
static libgda ()
{
gda_init ("System.Data.OleDb", "0.1", 0, null);
}
public static IntPtr GdaClient
{
get {
if (m_gdaClient == IntPtr.Zero)
m_gdaClient = gda_client_new ();
return m_gdaClient;
}
}
[DllImport("gda-2")]
public static extern void gda_init (string app_id,
string version,
int nargs,
string[] args);
[DllImport("gda-2")]
public static extern IntPtr gda_client_new ();
[DllImport("gda-2")]
public static extern IntPtr gda_client_open_connection (IntPtr client,
string dsn,
string username,
string password);
[DllImport("gda-2")]
public static extern bool gda_connection_is_open (IntPtr cnc);
[DllImport("gda-2")]
public static extern bool gda_connection_close (IntPtr cnc);
[DllImport("gda-2")]
public static extern string gda_connection_get_database (IntPtr cnc);
[DllImport("gda-2")]
public static extern string gda_connection_get_dsn (IntPtr cnc);
[DllImport("gda-2")]
public static extern string gda_connection_get_cnc_string (IntPtr cnc);
[DllImport("gda-2")]
public static extern string gda_connection_get_provider (IntPtr cnc);
[DllImport("gda-2")]
public static extern string gda_connection_get_username (IntPtr cnc);
[DllImport("gda-2")]
public static extern string gda_connection_get_password (IntPtr cnc);
[DllImport("gda-2")]
public static extern bool gda_connection_begin_transaction (IntPtr cnc,
string name);
[DllImport("gda-2")]
public static extern bool gda_connection_commit_transaction (IntPtr cnc,
string name);
[DllImport("gda-2")]
public static extern bool gda_connection_rollback_transaction (IntPtr cnc,
string name);
}
}
|