Last post Aug 28, 2011 08:25 PM by Lannie
Aug 25, 2011 02:29 PM|Gurdarshan|LINK
Whenever I try to establish connection with DB2 UDB database in .Net 2.0, it is taking 1-2 mins to open the connection. I'm using DB2Connecton in C# for this purpose.
sConnectionString_DB2 = "Server=DB2ServerName:PORT;Database=DATABASENAME;UID=USERNAME;PWD=PASSWORD;";
if (objDB2Con.State == ConnectionState.Closed)
objDB2Con.ConnectionString = sConnectionString_DB2;
Aug 28, 2011 08:25 PM|Lannie|LINK
Since DB2 authenticates with Windows, your Domain Controller may induce slow initial connection.
Read about the DB2 activate command to explicitly activate the database when you first start your application using DB2
before you make your first connection. That way you have pre-activated the DB2 services, open files, logs updated, etc.
If in a complex network environment, multilayer firewalls/security controllers may have rules contributing to the connection latency.
If you are using ODBC driver... it is sloowwwww.