IBM.Data.DB2.Core error in new DB2Connection(connectionString)


We have the IBM.Data.DB2.Core ( nuget package installed in our .netstandard2.1 application library, to connect to an external DB2 instance on prem.

On running the following code from a .net core azure function v3 Windows 64bit (from a netcoreapp3.1 project)

var connectionString= "Server=DB2_IP:DB2_Port;Database=DB2_DBNAME;UID=DB2_UserId;PWD=DB2_Password;"
var connection = new DB2Connection(connectionString);
(note the values in the connection string are placeholders for anonymity)

We are receiving the following error

IBM.Data.DB2.Core.DB2Exception (0x80004005): ERROR [58005] [IBM][DB2.NET] SQL0902 An unexpected 
exception has occurred in  
Process: 21308 Thread 33 AppDomain: Name:Microsoft.Azure.WebJobs.Script.WebHost
There are no context policies. Function: AESEncryptADONET (Encryption Info)
 CallStack:    at System.Environment.get_StackTrace()
   at IBM.Data.DB2.Core.DB2ConnPool.HandleUnknownErrors(String strFncMsg, Exception exception, Boolean bThrow)
   at IBM.Data.DB2.Core.DB2ConnPool.EncryptString(String value)
   at IBM.Data.DB2.Core.DB2ConnPool.ReplaceConnectionStringParms(DB2Connection connection, String szValue, DB2ConnSettings& pSettings, DB2ConnSettingsInternal& pSettingsInternal, Boolean bAttach, Boolean pushDownStrAppended)
   at IBM.Data.DB2.Core.DB2Connection.set_ConnectionString(String value)
   at IBM.Data.DB2.Core.DB2Connection..ctor(String connectionString)

Does anyone have any idea where we're going wrong, or alternatively have a coherent end-to-end guide on the setup that may give me a clue.

All documentations I have found thus far has been rather sparse and a little inconsistent.

asked on Stack Overflow Oct 8, 2020 by Sarah • edited Oct 8, 2020 by Sarah

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0