21 The Salesforce Driver

21
The DataDirect Connect XE for ODBC and DataDirect Connect64 XE for ODBC Salesforce driver (the Salesforce driver) supports the standard SQL query language to fetch, insert, update, and delete data from Salesforce.com, Force.com, and Database.com.
NOTE: For the Salesforce Web Service API versions supported by the Salesforce driver, refer to the product matrix on the Progress DataDirect Web site:
http://www.datadirect.com/products/odbc/matrix/connectodbc.htm
NOTE: You can query the SYSTEM_REMOTE_SESSIONS system table to get the version of the Web Service API the driver supports.
The driver translates the SQL statements provided by the application to Salesforce queries (SOQL) and Web service calls. Refer to Chapter 10 “SQL Statements and Extensions for the Salesforce Driver” in the DataDirect Connect Series for ODBC Reference for the SQL statements that the driver supports.
The driver maps the Salesforce data model into a set of related relational tables. The mapping representation is stored in XML files external to the driver. This allows the sharing of map files among different client machines.
The driver uses a client-side data cache for improved performance. You can define rules that specify which data to cache on the client as well as when the cached data becomes invalid and needs to be refreshed (see “Client-Side Caches” for details).
The Salesforce driver can be used with industry standard tools, which means that developers can leverage their existing SQL knowledge instead of having to learn the Salesforce query language and APIs. Examples include the following tools:
The driver is supported in the Windows, UNIX, and Linux environments. See “Environment-Specific Information” for detailed information about the environments supported by this driver.
Refer to the readme file shipped with your DataDirect Connect XE product for the file name of the driver.
Figure 21-1 shows the different components of an environment that uses the Salesforce driver to access Salesforce. Depending on your license from Salesforce.com, the driver could instead connect to Force.com or Database.com.
Figure 21-1. Salesforce DriverApplication opens a Web Service Session and a Database Session
 
When an application connects to Salesforce through the driver, connectivity to Salesforce is real-time, out of the box. In the background, the driver establishes a Web service session with the Salesforce instance and a database session that opens an embedded database. The application can establish multiple sessions with Salesforce; however, additional Web service and database sessions are always opened in the ratio of one database session per Web service session. The database session maintains the object-to-relational table mapping. In addition, it maintains cached tables and local tables, as well as maintaining views. See “Database Configuration File” for more details.
On Windows, the SQL Engine can be run within the same process space as the ODBC application, or it can be run as a separate process. Some applications may experience problems loading the JVM required for the SQL Engine because the process exceeds the available heap space. If your application experiences problems loading the JVM, you can configure the Salesforce driver to run in a separate 32-bit process within its own JVM. See “Configuring the SQL Engine Server” for more information.
Salesforce has certain standard objects that always exist, even if they do not contain anything. Salesforce administrators can also create custom objects using the Salesforce browser interface. Custom Salesforce objects cannot be created by the driver. The relationships among these objects are tabular, like those among the tables in a database. The Salesforce driver recognizes the relationships among both standard Salesforce objects and custom objects and can access, create, and update both. The relationships among objects can be reported through the ODBC SQLForeignKeys and SQLPrimaryKeys functions. The driver leverages Salesforce mechanisms for joining data, minimizing the amount of data that needs to be fetched over the network.