简体   繁体   English

PHP中的zOS DB2连接字符串-从Bluemix到zOS

[英]zOS DB2 connection string in PHP - from Bluemix to zOS

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. 我有一个来自云上DashDB(DB2)的示例连接字符串,当我从Bluemix(一个PHP云铸造应用程序)连接到基于云的DB2时,该字符串有效。

Now I would like to connect to a zOS DB2 DB using a Secure Gateway. 现在,我想使用安全网关连接到zOS DB2 DB。 I have the SG already set up and I have SG hostname and port also. 我已经设置了SG,并且也有SG主机名和端口。

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: 这是使用DashDB中的示例的连接字符串准备,并为此zOS DB2数据库添加Secure Gatway主机名和端口号以及我的pw和我的userID:

        $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..) 这是建立的连接字符串(也来自DashDB示例。)

$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? 我是否为zOS / DB2使用了正确的驱动程序?

and here is the connection command in PHP: 这是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.) 我为安全网关支持团队打开了一张票,因为使用各种设置都会收到SQL30081N错误消息(基于是否使用SG Desktop Client连接-它正在运行,-它未运行,我正在使用托管的SG Client ..,如果我不这样做)不要使用SG并尝试直接从桌面连接到zOS(这种情况下,我收到许可证错误,因为我尚未设置zOS许可证文件。)

Is it possible that the missing license causing the SQL30081N error too? 丢失的许可证是否也可能导致SQL30081N错误?

Support tells that I have an application error. 支持人员告诉我我有一个应用程序错误。 Is it possible that I'm using the wrong connection string? 我是否可能使用了错误的连接字符串?

SQL30081N did not found any suggestion on the web yet.. but I received this error message because of Secure Gatway ACL file content. SQL30081N尚未在网上找到任何建议。.但是由于Secure Gatway ACL文件的内容,我收到了此错误消息。 ... fixed it and it works now. ...修复它,现在可以使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM