質問編集履歴
1
コード追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -50,6 +50,118 @@
|
|
50
50
|
|
51
51
|
|
52
52
|
|
53
|
+
```
|
54
|
+
|
55
|
+
using System;
|
56
|
+
|
57
|
+
using System.Data.Odbc;
|
58
|
+
|
59
|
+
using System.Data;
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
namespace ConsoleApplication8
|
64
|
+
|
65
|
+
{
|
66
|
+
|
67
|
+
class Program
|
68
|
+
|
69
|
+
{
|
70
|
+
|
71
|
+
static void Main(string[] args)
|
72
|
+
|
73
|
+
{
|
74
|
+
|
75
|
+
DataSet ds = new DataSet();
|
76
|
+
|
77
|
+
DataTable dt = new DataTable();
|
78
|
+
|
79
|
+
string server = "";
|
80
|
+
|
81
|
+
string port = "5439";
|
82
|
+
|
83
|
+
string masterUsername = "";
|
84
|
+
|
85
|
+
string masterUserPassword = "";
|
86
|
+
|
87
|
+
string DBName = "";
|
88
|
+
|
89
|
+
string query = "select *;";
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
try
|
94
|
+
|
95
|
+
{
|
96
|
+
|
97
|
+
//Redshift ODBC Driver - 64 bits
|
98
|
+
|
99
|
+
string connString = "上記";
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
// Make a connection using the psqlODBC provider.
|
104
|
+
|
105
|
+
OdbcConnection conn = new OdbcConnection(connString);
|
106
|
+
|
107
|
+
conn.Open();
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
var redshift = new Amazon.Redshift.Model.Cluster();
|
112
|
+
|
113
|
+
//redshift.
|
114
|
+
|
115
|
+
//redshifftconnection = new RedshiftConnection();
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
// Try a simple query.
|
120
|
+
|
121
|
+
string sql = query;
|
122
|
+
|
123
|
+
OdbcDataAdapter da = new OdbcDataAdapter(sql, conn);
|
124
|
+
|
125
|
+
da.Fill(ds);
|
126
|
+
|
127
|
+
dt = ds.Tables[0];
|
128
|
+
|
129
|
+
foreach (DataRow row in dt.Rows)
|
130
|
+
|
131
|
+
{
|
132
|
+
|
133
|
+
Console.WriteLine(row["table_catalog"] + ", " + row["table_name"]);
|
134
|
+
|
135
|
+
}
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
conn.Close();
|
140
|
+
|
141
|
+
Console.ReadKey();
|
142
|
+
|
143
|
+
}
|
144
|
+
|
145
|
+
catch (Exception ex)
|
146
|
+
|
147
|
+
{
|
148
|
+
|
149
|
+
Console.Error.WriteLine(ex.Message);
|
150
|
+
|
151
|
+
Console.ReadKey();
|
152
|
+
|
153
|
+
}
|
154
|
+
|
155
|
+
}
|
156
|
+
|
157
|
+
}
|
158
|
+
|
159
|
+
}
|
160
|
+
|
161
|
+
```
|
162
|
+
|
163
|
+
|
164
|
+
|
53
165
|
###試したこと
|
54
166
|
|
55
167
|
AmazonRedshiftODBC64-1.3.7.1000.msiをインストール。
|