locked
Establish Connection with DB2 UDB Database RRS feed

  • Question

  • User842016797 posted

    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;
     objDB2Con.Open();

    Thursday, August 25, 2011 2:29 PM

All replies

  • User269602965 posted

    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.

    Sunday, August 28, 2011 8:25 PM