Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Configure Database Access
The top-level database configuration object is the DatabaseConfig bean, which has these properties.
- sqlConfig—The SQL configuration bean for the data access object that interacts with a database.
- dataSource—The bean that acts as database driver and authenticator. It must refer to an implementation of javax.sql.DataSource such as org.apache.commons.dbcp.BasicDataSource.
This code is an example of a DatabaseConfig bean:
1<bean id="AccountInsert"
2 class="com.salesforce.dataloader.dao.database.DatabaseConfig"
3 scope="singleton">
4 <property name="sqlConfig" ref="accountInsertSql"/>
5</bean>The DataSource bean sets the physical information needed for database connections. It contains the following properties:
- driverClassName—The fully qualified name of the implementation of a JDBC driver.
- password—The password for logging in to the database.
- url—The string for physically connecting to the database.
- username—The username for logging in to the database.
Depending on your implementation, additional information is required. For example, use org.apache.commons.dbcp.BasicDataSource when database connections are pooled.
1<bean id="oracleRepDataSource"
2 class="org.apache.commons.dbcp.BasicDataSource"
3 destroy-method="close"
4 scope="prototype">
5 <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
6 <property name="url" value="jdbc:oracle:thin:@myserver.salesforce.com:1521:TEST"/>
7 <property name="username" value="test"/>
8 <property name="password" value="test"/>
9</bean>Versions of Data Loader from API version 25.0 onwards do not come with an Oracle JDBC driver. Using Data Loader to connect to an Oracle data source without a JDBC driver installed results in a “Cannot load JDBC driver class” error. To add the Oracle JDBC driver to Data Loader:
- Download the latest JDBC driver from http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html.
- Copy the JDBC .jar file to data loader install folder/java/bin.