Beispiel #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);
        }
Beispiel #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);
        }