douchen1924 2012-08-20 16:14
浏览 60
已采纳

php db2_connect - 正在使用什么驱动程序?

    $connection = db2_connect ( '*LOCAL', PHP_USER_NAME, PHP_USER_PASS );
    if (! $connection) {
        die('Could not connect');
    }

    //Prepare and execute the SQL statement.
    $stmt = db2_prepare ( $connection, $sqlStatement );

    if (! db2_execute ( $stmt ) ) {
        Throw New Exception('Could not execute statement');
    }

We are running PHP on an IBM iSeries with Apache. Our database is also on this iSeries.

What sort of connection is being established? Is it an ODBC link? If this is something that varies from system to system, how can i tell?

  • 写回答

1条回答 默认 最新

  • douwei1930 2012-08-20 17:03
    关注

    It seems that is is a ODBC connection:

    Try running the function db2_client_info on your client, this should output the needed info. You can run the following code:

    <?php
    $conn = db2_connect( '*LOCAL', PHP_USER_NAME, PHP_USER_PASS );
    $client = db2_client_info( $conn );
    
    if ($client) {
        echo "DRIVER_NAME: ";           var_dump( $client->DRIVER_NAME );
        echo "DRIVER_VER: ";            var_dump( $client->DRIVER_VER );
        echo "DATA_SOURCE_NAME: ";      var_dump( $client->DATA_SOURCE_NAME );
        echo "DRIVER_ODBC_VER: ";       var_dump( $client->DRIVER_ODBC_VER );
        echo "ODBC_VER: ";              var_dump( $client->ODBC_VER );
        echo "ODBC_SQL_CONFORMANCE: ";  var_dump( $client->ODBC_SQL_CONFORMANCE );
        echo "APPL_CODEPAGE: ";         var_dump( $client->APPL_CODEPAGE );
        echo "CONN_CODEPAGE: ";         var_dump( $client->CONN_CODEPAGE );
    }
    else {
        echo "Error retrieving client information.
         Perhaps your database connection was invalid.";
    }
    db2_close($conn);
    
    ?>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 求快手直播间榜单匿名采集ID用户名简单能学会的
  • ¥15 DS18B20内部ADC模数转换器
  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历