Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 class db2Connection
00016 {
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 private $objConnection;
00028
00029
00030
00031
00032
00033
00034
00035 private $objDatasource;
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 public function __construct( $datasource )
00048 {
00049 $this->objDatasource = $datasource;
00050 $this->objDatasource[5] = ( array_key_exists( 5, $this->objDatasource ) && $this->objDatasource[5] ) ? true : false;
00051 }
00052
00053
00054
00055
00056
00057
00058
00059 public function objDbConnection()
00060 {
00061 $this->objConnection = ( $this->objDatasource[5] ) ? db2_pconnect( $this->objDatasource[4], $this->objDatasource[2], $this->objDatasource[3] )
00062 : db2_connect( $this->objDatasource[4], $this->objDatasource[2], $this->objDatasource[3] );
00063
00064 if ( !$this->objConnection )
00065 trigger_error( db2_conn_errormsg(), E_USER_WARNING );
00066
00067 return $this->objConnection;
00068 }
00069
00070
00071
00072
00073
00074
00075
00076 public function objDbClose()
00077 {
00078 return db2_close( $this->objConnection );
00079 }
00080
00081
00082
00083
00084
00085
00086
00087 public function objServerVersion()
00088 {
00089 $objVer = db2_server_info( $this->objConnection );
00090
00091 return $objVer->DBMS_NAME . ' - ' . $objVer->DBMS_VER;
00092 }
00093 }
00094
00095 ?>