# Changes to the XQuery Java API

The Java API for invoking XQuery has been simplified: there is no longer any need to create a `QueryProcessor` object, and the constructor for the `QueryProcessor` has been deprecated. Instead, all the methods that were previously available on the `QueryProcessor` can now be invoked directly on the `StaticQueryContext` object.

The constructor for the `DynamicQueryContext` object now requires a `Configuration` object to be supplied. This must be the same as the `Configuration` that was used when creating the `StaticQueryContext`.

A new sample program, `QueryAPIExamples.java`, is available in the `samples/java` directory. This illustrates most of the different ways of using the XQuery Java API.

Next