Oracle.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Db
  17. * @subpackage UnitTests
  18. * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id $
  21. */
  22. /**
  23. * @see Zend_Db_TestUtil_Pdo_Oci
  24. * @see Zend_Db_TestUtil_Common
  25. */
  26. require_once 'Zend/Db/TestUtil/Pdo/Oci.php';
  27. PHPUnit_Util_Filter::addFileToFilter(__FILE__);
  28. /**
  29. * @category Zend
  30. * @package Zend_Db
  31. * @subpackage UnitTests
  32. * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  33. * @license http://framework.zend.com/license/new-bsd New BSD License
  34. */
  35. class Zend_Db_TestUtil_Oracle extends Zend_Db_TestUtil_Pdo_Oci
  36. {
  37. protected function _rawQuery($sql)
  38. {
  39. $conn = $this->_db->getConnection();
  40. $stmt = oci_parse($conn, $sql);
  41. if (!$stmt) {
  42. $e = oci_error($conn);
  43. require_once 'Zend/Db/Exception.php';
  44. throw new Zend_Db_Exception("SQL parse error for \"$sql\": ".$e['message']);
  45. }
  46. $retval = oci_execute($stmt);
  47. if (!$retval) {
  48. $e = oci_error($conn);
  49. require_once 'Zend/Db/Exception.php';
  50. throw new Zend_Db_Exception("SQL execute error for \"$sql\": ".$e['message']);
  51. }
  52. }
  53. }