我试图将.NET Core控制台应用程序连接到服务器上存储的Db2数据库,但出现此错误:
错误[42968] [IBM] SQL1598N尝试连接到数据库 服务器由于许可问题而失败。 SQLSTATE = 42968
string c2 = "Server=xxx.xxxx.xx.xx:446; Database=XXX; UID=XXX; PWD=XXX";
try
{
using (var connection = new DB2Connection(c2))
{
connection.Open();
using (var command = connection.CreateCommand())
{
command.CommandText = "SELECT *FROM IMMO_OPE";
using (var reader = command.ExecuteReader())
{
while (reader.Read())
{
Console.WriteLine(reader.GetString(0));
}
}
}
}
}
catch(Exception ex)
{
Console.WriteLine(ex.Message);
}
Console.Read();
我已经用:
ibm.data.db2.core 1.0.0.100
ibm.data.db2.core 1.3.0.100