/**
  * Supports getClob() and setClob() tests.
  *
  * @see ResultSetTest::getClob()
  * @see PreparedStatementTest::setClob()
  * @return Clob
  */
 public function createClob()
 {
     // read in the file
     $c = new Clob();
     $c->setInputFile(CREOLE_TEST_BASE . '/etc/lob/creoleguide.txt');
     return $c;
 }
Esempio n. 2
0
 /**
  * @see ResultSet::getClob()
  */
 public function getClob($column)
 {
     $idx = is_int($column) ? $column - 1 : $column;
     if (!array_key_exists($idx, $this->fields)) {
         throw new SQLException("Invalid resultset column: " . $column);
     }
     if ($this->fields[$idx] === null) {
         return null;
     }
     require_once 'creole/util/Clob.php';
     $c = new Clob();
     $c->setContents($this->fields[$idx]);
     return $c;
 }
Esempio n. 3
0
 /**
  * @param string $paramIndex
  * @param mixed $clob Clob object or string containing data.
  * @return void
  */
 function setClob($paramIndex, $clob)
 {
     require_once CREOLE_ROOT . 'util/Clob.php';
     if (!$clob instanceof Clob) {
         $c = new Clob();
         $c->setContents($clob);
         $clob = $c;
     }
     $this->lobDescriptors[$paramIndex] = oci_new_descriptor($this->conn->getResource(), OCI_D_LOB);
     $this->lobs[$paramIndex] = $clob;
 }
 /**
  * @see ResultSet::getClob()
  */
 public function getClob($column)
 {
     if ($this->fetchmode == ResultSet::FETCHMODE_NUM) {
         $column--;
     }
     if (!isset($this->fieldsInResultSet[$column])) {
         throw new SQLException("Invalid resultset column: " . $column);
     }
     if ($this->fields[$column] === null) {
         return null;
     }
     require_once 'creole/util/Clob.php';
     $c = new Clob();
     $c->setContents($this->fields[$column]);
     return $c;
 }
 /**
  * @see ResultSet::getClob()
  */
 public function getClob($column)
 {
     require_once 'creole/util/Clob.php';
     $idx = is_int($column) ? $column - 1 : $column;
     if (!array_key_exists($idx, $this->fields)) {
         throw new SQLException("Invalid resultset column: " . $column);
     }
     $data = $this->readLobData($column, ODBC_BINMODE_CONVERT, $this->fields[$idx]);
     if (!$data) {
         return null;
     }
     $c = new Clob();
     $c->setContents($data);
     return $c;
 }
Esempio n. 6
0
 /**
  * @see CallableStatement::getClob()
  */
 function getClob($paramIndex)
 {
     if (!array_key_exists($paramIndex, $this->boundOutVars)) {
         throw new SQLException('Requesting variable not bound to output var: ' . $paramIndex);
     }
     if ($this->boundOutVars[$paramIndex] === null) {
         return null;
     }
     require_once 'creole/util/Clob.php';
     $c = new Clob();
     $c->setContents($this->boundOutVars[$paramIndex]);
     return $c;
 }
Esempio n. 7
0
 public function setRequest($v)
 {
     if ($v instanceof Lob && $v === $this->request) {
         $changed = $v->isModified();
     } else {
         $changed = $this->request !== $v;
     }
     if ($changed) {
         if (!$v instanceof Lob) {
             $obj = new Clob();
             $obj->setContents($v);
         } else {
             $obj = $v;
         }
         $this->request = $obj;
         $this->modifiedColumns[] = sfErrorLogPeer::REQUEST;
     }
 }