---
schema_version: "1"
id: 323560417a6e9bba8f4c041072227f85c5c1d7df72fca2ea8bbde8a43360cd71
title: Configure Database Access
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/data-loader-impl/guides/data-loader/loader-dbaccess.md
canonical_url: https://developer.salesforce.com/docs/platform/data-loader-impl/guide/loader-dbaccess.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 407c659f98b4a1c21afa54369755d418af23c564f2e114edf4cf13651215f414
products:
  - Data Loader Guide
  - Platform Developer Content
---

# Configure Database Access

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.

**note:** The Data Loader command-line interface is supported for Windows only.

DatabaseConfig Bean

The top-level database configuration object is the `DatabaseConfig` bean, which has these properties.

-   sqlConfig—The [SQL configuration bean](https://developer.salesforce.com/docs/platform/data-loader-impl/guide/loader-sql.md) 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:

```xml
<bean id="AccountInsert"
    class="com.salesforce.dataloader.dao.database.DatabaseConfig"
    scope="singleton">
    <property name="sqlConfig" ref="accountInsertSql"/>
</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.
-   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.

The following code is an example of a DataSource bean:

```xml
<bean id="oracleRepDataSource"
    class="org.apache.commons.dbcp.BasicDataSource"
    destroy-method="close"
    scope="prototype">
    <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
    <property name="url" value="jdbc:oracle:thin:@myserver.salesforce.com:1521:TEST"/>
    <property name="username" value="test"/>
    <property name="password" value="test"/>
</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](http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html).
-   Copy the JDBC .jar file to _data loader install folder_/java/bin.

