DBI connect() fails to establish the connection an

2019-08-26 09:43发布

问题:

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