コード例 #1
0
 /**
  * @covers Zend\Db\Adapter\Driver\Oci8\Connection::disconnect
  */
 public function testDisconnect()
 {
     $connection = new Connection($this->variables);
     $connection->connect();
     $this->assertTrue($connection->isConnected());
     $connection->disconnect();
     $this->assertFalse($connection->isConnected());
 }
コード例 #2
0
ファイル: Oci8.php プロジェクト: eltondias/Relogio
 /**
  * @param string $sqlOrResource
  * @return Statement
  */
 public function createStatement($sqlOrResource = null)
 {
     $statement = clone $this->statementPrototype;
     if (is_resource($sqlOrResource) && get_resource_type($sqlOrResource) == 'oci8 statement') {
         $statement->setResource($sqlOrResource);
     } else {
         if (is_string($sqlOrResource)) {
             $statement->setSql($sqlOrResource);
         } elseif ($sqlOrResource !== null) {
             throw new Exception\InvalidArgumentException('Oci8 only accepts an SQL string or a oci8 resource in ' . __FUNCTION__);
         }
         if (!$this->connection->isConnected()) {
             $this->connection->connect();
         }
         $statement->initialize($this->connection->getResource());
     }
     return $statement;
 }