The following are methods for QueryLocator. All are instance methods.
public String getQuery()
Type: String
You cannot use the FOR UPDATE keywords with a getQueryLocator query to lock a set of records. The start method automatically locks the set of records in the batch.
System.assertEquals(QLReturnedFromStart. getQuery(), Database.getQueryLocator([SELECT Id FROM Account]).getQuery() );
public Database.QueryLocatorIterator iterator()
For an example, see QueryLocatorIterator Class.