13.07.2015 Views

Using SQL Adapters with Ensemble - InterSystems Documentation

Using SQL Adapters with Ensemble - InterSystems Documentation

Using SQL Adapters with Ensemble - InterSystems Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

About the <strong>Ensemble</strong> <strong>SQL</strong> <strong>Adapters</strong>1.2 Helper Classes<strong>Ensemble</strong> provides two helper classes that are used as arguments and return values for the built-in<strong>SQL</strong> methods:• The EnsLib.<strong>SQL</strong>.GatewayResultSet class represents a special-purpose result set for use in<strong>Ensemble</strong>. An initialized instance of this class has a live data connection to a data source. Theclass provides methods to examine the contents of the result set as well as a method to return astatic snapshot.• The EnsLib.<strong>SQL</strong>.Snapshot class represents a static object that you can create and populate in variousways. For example, you can populate it <strong>with</strong> the data of a result set, either all the rows or asubset of rows (starting at some row position). Or you can populate it <strong>with</strong> the contents of a fileor stream. Or you can construct it row by row.The class provides methods for examining the data; more methods are available for this objectthan for the result set.1.3 General UseAt a high level, to include an adapter in a production, you do the following:• Create a business host (specifically a business service or business operation) class that uses theadapter. You use the ADAPTER parameter of the business host class to specify the adapter to use.• Within that class, implement the methods you need. Your methods will typically use the propertiesand methods of the associated adapter, via the Adapter property of your business host.• Add the business service or business operation to your production and provide values for anyruntime settings.In most cases, your custom code resides <strong>with</strong>in your business host class. You do not typically need tocustomize the adapters directly.4 <strong>Using</strong> <strong>SQL</strong> <strong>Adapters</strong> <strong>with</strong> <strong>Ensemble</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!