/** * Constructor * * @param OciPdo $pdooci PDOOCI connection * @param string $statement sql statement * * @throws \PDOException */ public function __construct(OciPdo $pdooci, $statement) { try { $this->_pdooci = $pdooci; $this->_con = $pdooci->getConnection(); $this->_statement = OciPdoStatement::insertMarks($statement); $this->_stmt = \oci_parse($this->_con, $this->_statement); $this->_fetch_sty = \PDO::FETCH_BOTH; $this->_queryString = $this->_statement; } catch (\Exception $e) { throw new \PDOException($e->getMessage()); } }
/** * Execute a query * * @param string $statement sql query * @param int $mode PDO query() mode * @param int $p1 PDO query() first parameter * @param int $p2 PDO query() second parameter * * @return OciPdoStatement * @throws PDOException */ public function query($statement, $mode = null, $p1 = null, $p2 = null) { // TODO: use mode and parameters $stmt = null; try { $stmt = new OciPdoStatement($this, $statement); $stmt->execute(); $this->setError(); return $stmt; } catch (\Exception $e) { throw new PDOException($e->getMessage()); } }