/** * Prepare a statement handle. * * @param string $sql * @return void * @throws Zend_Db_Statement_Db2_Exception */ public function _prepSql($sql) { parent::_prepSql($sql); $connection = $this->_adapter->getConnection(); $this->_stmt = db2_prepare($connection, $sql); if (!$this->_stmt) { require_once 'Zend/Db/Statement/Db2/Exception.php'; throw new Zend_Db_Statement_Db2_Exception(db2_stmt_errormsg(), db2_stmt_error()); } }
/** * @param string $sql * @return void * @throws Zend_Db_Statement_Mysqli_Exception */ public function _prepSql($sql) { parent::_prepSql($sql); $mysqli = $this->_adapter->getConnection(); $this->_stmt = $mysqli->prepare($sql); if ($this->_stmt === false || $mysqli->errno) { /** * @see Zend_Db_Statement_Mysqli_Exception */ require_once 'Zend/Db/Statement/Mysqli/Exception.php'; throw new Zend_Db_Statement_Mysqli_Exception("Mysqli prepare error: " . $mysqli->error); } }
/** * Prepare statement handle */ public function _prepSql($sql) { Zend_Db_Statement::_prepSql($sql); $connection = $this->_connection->getConnection(); $this->_stmt = db2_prepare($connection, $sql); if (!$this->_stmt) { throw new Zend_Db_Statement_Db2_Exception(db2_stmt_errormsg($this->_stmt), db2_stmt_error($this->_stmt)); } }