Newer Version Available
Configure Database Access
| Available in: Salesforce Classic (not available in all orgs) and Lightning Experience |
| Available in: Enterprise, Performance, Unlimited, Developer, and Database.com Editions |
When you run Data Loader in batch mode from the command line, use \samples\conf\database-conf.xml to configure database access objects, which you use to extract data directly from a database.
DatabaseConfig Bean
The top-level database configuration object is the DatabaseConfig bean, which has the following 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.
The following code is an example of a DatabaseConfig bean:
1<bean id="AccountInsert"
2 class="com.salesforce.dataloader.dao.database.DatabaseConfig"
3 singleton="true">
4 <property name="sqlConfig" ref="accountInsertSql"/>
5</bean>DataSource
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.
- url
- The string for physically connecting to the database.
- username
- The username for logging in to the database.
- password
- The password for logging in to the database.
Depending on your implementation, additional information may be 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 <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
5 <property name="url" value="jdbc:oracle:thin:@myserver.salesforce.com:1521:TEST"/>
6 <property name="username" value="test"/>
7 <property name="password" value="test"/>
8</bean>- 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.