Using Cached Data
The provider also supports a third caching mode called offline mode, in which all statements are executed against the local cache database and not the real data source. This is enabled by setting the Offline option in the Connection String.
With offline mode, any SELECT statements you execute will always execute on the local cache database, regardless of whether you specify a table_name#Cache table or not. Modification of the cache is disabled in offline mode to prevent accidentally updating only the cached data. Executing a DELETE/UPDATE/INSERT statement while Offline is set will result in an exception.
Queries in offline mode do not have the same syntax limitations as queries run directly against the data source. In offline mode, any SQL query can be executed, including complex JOIN statements between multiple tables in the same database.
Select from the Cached Table
String query = "SELECT * FROM Lead WHERE FirstName='Bob' ORDER BY FullName ASC"; Connection connection = DriverManager.getConnection("user=myuseraccount;password=mypassword;URL=http://myserver/myOrgRoot;;Offline=true"); Statement stat = connection.createStatement(); stat.execute(query);Note: The above command will select from the local cache but not the live data source because Offline is set to True.