NetSuite Data Provider - Online Help
NetSuite Data Provider
Questions / Feedback?

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 enabled, SELECT statements will always execute against 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

The command below will select from the local cache but not the live data source because Offline is set to true.

Connection connection = DriverManager.getConnection("jdbc:netsuite:Account Id=XABC123456;Password=password;User=user;Role Id=3;Version=2013_1;Location=C:\\myfolder\\;Offline=true;Cache Location=C:\\cache.db;");
Statement stat = connection.createStatement();
String query = "SELECT * FROM Account WHERE acctName='Checking' ORDER BY AcctName ASC";
stat.execute(query);
connection.close();

 
 
Copyright (c) 2015 RSSBus, Inc. - All rights reserved.
Build 1.0.5577.0