DBI connect() fails to establish the connection and doesnt return an error message

我们两清 提交于 2019-12-12 05:19:57

问题


When i am trying to establish a connection to database, it fails. But It doesnt return any error message either.

Code for it is as below

 my $dbh;
    $dbh = DBI->connect('DBI:SQLAnywhere:', $connString, undef, {PrintError => 0, PrintWarn => 0})or die "died",$DBI::errstr,"\n";
    #dbh = DBI->connect('DBI:SQLAnywhere:', $connString);
    # setting up the authentication signature for the connection
    print "$dbh";
    if($dbh)
    {

       if(DbAuth::AuthenticateConnection($dbh))
       {    
          return($dbh,$DbAuth::errstr) if (wantarray());
       }
    }

    if (wantarray())
    {
    # The caller is prepared to deal with errors, so pass back the
    # error string.  It should only be used when the db_handle is 0.
    return ($dbh, $DBI::errstr);
    }
    else
    {
    return $dbh;
    }

Any idea why this is happening and how can i debug this issue?

Note: I upgraded perl from 5.8 to 5.24

来源:https://stackoverflow.com/questions/44906829/dbi-connect-fails-to-establish-the-connection-and-doesnt-return-an-error-messa

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!