Exemplo n.º 1
0
        protected static PDOStatement prepare(Env env,
                                              PDO pdo,
                                              PDOError error,
                                              string query,
                                              bool isCatchException)

        {
            PDOStatement stmt = new PDOStatement(env, pdo, error);

            query = stmt.parseQueryString(env, query);

            stmt._stmt = pdo.getConnection().prepare(env, query);

            SQLException e = stmt._stmt.getException();

            if (e != null)
            {
                if (!isCatchException)
                {
                    throw e;
                }

                error.error(env, e);
            }

            // php/1s41 - oracle can't handle this
            //_preparedStatement.setEscapeProcessing(false);

            stmt.queryString = query;

            return(stmt);
        }
Exemplo n.º 2
0
        protected static PDOStatement execute(Env env,
                                              PDO pdo,
                                              PDOError error,
                                              string query,
                                              bool isCatchException)

        {
            PDOStatement stmt = new PDOStatement(env, pdo, error);

            stmt.init(pdo.getConnection().createStatement(env), query);

            try {
                bool result = stmt._stmt.execute(env, false);
            }
            catch (SQLException e) {
                if (!isCatchException)
                {
                    throw e;
                }

                error.error(env, e);
            }

            return(stmt);
        }
Exemplo n.º 3
0
        // protected so it's not callable by PHP code
        protected PDOStatement(Env env,
                               PDO pdo,
                               PDOError error)
        {
            env.addCleanup(this);

            _pdo   = pdo;
            _error = error;
        }