function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Glenn at MvistaGlenn at Mvista 

Data access object error when using Data Loader command line with MS SQL

I have been scouring the online forums trying to get the data loader to read from MS SQL and then put some data into Salesforce.  I almost have it working (I can read from SF for example).  However, I am getting a error around creating the data access object on the databaseRead command.  I am looking at all the config files and I think what is missing is the table name.  I have the server, the database, the login and password etc.  and that all works.  But the actual query, using a bean, does not have the table in it.  I have tried to place is a variety of places without success.

Can someone please show me the database-conf.xml parameters that I need, with them explained (most of the docs list "example" without breaking down the components so I have no idea which relates to server vs database vs table).

For example, here is what I have and what I think the pieces are show in <>.  As you can see I am stymied on table name.

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
    <bean id="dbDataSource" class="org.apache.commons.dbcp.BasicDataSource"
        destroy-method="close">
        <property name="driverClassName" value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
        <property name="url" value="jdbc:microsoft:sqlserver://localhost:1433;databaseName=<databasename>"/>
        <property name="username" value="somename"/>
        <property name="password" value="somepassword"/>
    </bean>
    <bean id="tmpProject" class="com.salesforce.dataloader.dao.database.DatabaseConfig" singleton="true">
        <property name="sqlConfig" ref="queryprojects"/>
        <property name="dataSource" ref="dbDataSource"/>
    </bean>
    <bean id="queryprojects" class="com.salesforce.dataloader.dao.database.SqlConfig" singleton="true">
        <property name="sqlString">
            <value> select Project_Code__c, Name, Project_Number__c from tmpProject
        </value>
        </property>
    </bean>
</beans>

Any help is appreciated.

cjarviscjarvis

Here's a sample SqlConfig bean.  In your case it looks like you have specified sqlString but not the list "columnNames" to correspond with your sql.

The results of your query will be labeled using those column names.  If you are not sure how to specify the sfdc table name, that is in process.conf you must specify a value for "sfdc.Entity".

 


<bean id="queryAccountSql" class="com.salesforce.dataloader.dao.database.SqlConfig"    singleton="true">

    <property name="sqlString">

        <value> SELECT ACCOUNT_NAME, BUSINESS_PHONE

            FROM ACCOUNT_SQL_TBL</value>

    </property>

    <property name="columnNames">

        <list>

            <value>account_name</value>

            <value>business_phone</value>

        </list>

    </property>

</bean>