0

I have a sample connection string from DashDB (DB2) on cloud that worked when I connected from Bluemix (A PHP cloud foundry app) to a cloud based DB2.

Now I would like to connect to a zOS DB2 DB using a Secure Gateway. I have the SG already set up and I have SG hostname and port also.

Here is the connection string preparation using the sample from DashDB and adding the Secure Gatway hostname and port number and my pw and my userID for this zOS DB2 database:

        $database = "EU***DB2*";        
        $hostname = "cio-sg-02.integration.ibmcloud.com";  
        $user     = "**myuserID**";   
        $password = "**myPW**";   
        $port     = **portfromSecureGatway**;          
        $ssl_port = **portfromSecureGatway**;          

Here is the connection string build up (also from the DashDB sample..)

$driver  = "DRIVER={IBM DB2 ODBC DRIVER};";
        $dsn     = "DATABASE=$database; " .
                   "HOSTNAME=$hostname;" .
                   "PORT=$port; " .
                   "PROTOCOL=TCPIP; " .
                   "UID=$user;" .
                   "PWD=$password;";
        $ssl_dsn = "DATABASE=$database; " .
                   "HOSTNAME=$hostname;" .
                   "PORT=$ssl_port; " .
                   "PROTOCOL=TCPIP; " .
                   "UID=$user;" .
                   "PWD=$password;" .
                   "SECURITY=SSL;";
        $conn_string = $driver . $dsn;     # Non-SSL
        //$conn_string = $driver . $ssl_dsn; # SSL

Am I using the right driver for zOS/DB2?

and here is the connection command in PHP:

$connection = db2_connect($conn_string,$user,$password);

I opened a ticket for Secure Gateways Support team because I get SQL30081N error message with various setups (based on if I connect using SG Desktop Client - its running, - its not running, I'm using hosted SG Client.. and if I don't use SG and try to connect directly to zOS from my desktop (that case I receive license error as I don't have the zOS license file set up yet.)

Is it possible that the missing license causing the SQL30081N error too?

Support tells that I have an application error. Is it possible that I'm using the wrong connection string?

11
  • Static part of the SQL30081N error for each scenario I try: Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS" SQLSTATE=08001 SQLCODE=-30081 Commented Jun 4, 2018 at 7:35
  • SG with SG Desktop Client turned ON - Communication function detecting the error: "recv". Protocol specific error code(s): "", "", "0". Commented Jun 4, 2018 at 7:35
  • SG with SG Desktop Client turned OFF - Communication function detecting the error: "connect". Protocol specific error code(s): "111", "", "". Commented Jun 4, 2018 at 7:35
  • SG with SG COUD Client - Communication function detecting the error: "recv". Protocol specific error code(s): "", "", "0" Commented Jun 4, 2018 at 7:35
  • 2
    The SQLCODE -30081 reason code has <rc1><rc2><rc3>. The <rc3> "0" means remote side terminated the connection (either SG or Z/OS), and "111" means connection-refused. Does the SG allow both unencrypted and encrypted connections? If so, does the symptom change when using unencrypted versus encrypted connections? Did you get the cert for your Z/OS hostname and use it? Commented Jun 4, 2018 at 11:19

1 Answer 1

0

SQL30081N did not found any suggestion on the web yet.. but I received this error message because of Secure Gatway ACL file content. ... fixed it and it works now.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.