Ask Search:
API AutomationAPI Automation 

Bulk API command line SQL Server Data JDBC Access Object not found.

 I have downloaded the Microsoft JDBC driver for SQL Server 2008 (version 3.0 & I also tried 2.0). I added a CLASSPATH to my system environment variables (tried the default location and placing the sqljdbc.jar in the root, too).

This is the Data Access Object that I tried to create. The error message appears below, in bold type,  in the log output. Am I using the correct class?

<bean id="sqlServerDataSource"
      class="com.microsoft.sqlserver.jdbc.sqlserverdatasource"
      destroy-method="close"> 
    <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.sqlserverdriver"/> 
    <property name="url" value="jdbc:sqlserver://paassql01;database=PAAS;"/>
    <property name="url" value="jdbc:sqlserver://paassql01;database=PAAS;integratedSecurity=true;"/> 
</bean>


2011-05-12 22:06:19,970 INFO  [main] controller.Controller initLog (Controller.java:367) - The log has been initialized
2011-05-12 22:06:19,976 INFO  [main] process.ProcessConfig getBeanFactory (ProcessConfig.java:78) - Loading process configuration from config file: C:\Program Files\salesforce.com\Apex Data Loader 21.0\bin\..\PAASPORTconf\process-conf.xml
2011-05-12 22:06:20,018 INFO  [main] xml.XmlBeanDefinitionReader loadBeanDefinitions (XmlBeanDefinitionReader.java:163) - Loading XML bean definitions from file [C:\Program Files\salesforce.com\Apex Data Loader 21.0\bin\..\PAASPORTconf\process-conf.xml]
2011-05-12 22:06:20,050 INFO  [main] core.CollectionFactory <clinit> (CollectionFactory.java:66) - JDK 1.4+ collections available
2011-05-12 22:06:20,058 INFO  [main] core.CollectionFactory <clinit> (CollectionFactory.java:71) - Commons Collections 3.x available
2011-05-12 22:06:20,111 INFO  [SFuserNamesToSQLtestusers] controller.Controller initConfig (Controller.java:328) - The controller config has been initialized
2011-05-12 22:06:20,115 INFO  [SFuserNamesToSQLtestusers] process.ProcessRunner run (ProcessRunner.java:90) - Initializing process engine
2011-05-12 22:06:20,115 INFO  [SFuserNamesToSQLtestusers] process.ProcessRunner run (ProcessRunner.java:93) - Loading parameters
2011-05-12 22:06:21,022 INFO  [SFuserNamesToSQLtestusers] config.LastRun load (LastRun.java:101) - Last run info will be saved in file: C:\Program Files\salesforce.com\Apex Data Loader 21.0\bin\..\PAASPORTconf\SFuserNamesToSQLtestusers_lastRun.properties
2011-05-12 22:06:21,035 INFO  [SFuserNamesToSQLtestusers] process.ProcessRunner run (ProcessRunner.java:101) - Logging in to: https://login.salesforce.com
2011-05-12 22:06:21,043 INFO  [SFuserNamesToSQLtestusers] client.PartnerClient login (PartnerClient.java:448) - Beginning Partner Salesforce login ....
2011-05-12 22:06:21,064 INFO  [SFuserNamesToSQLtestusers] client.PartnerClient loginInternal (PartnerClient.java:487) - Salesforce login to https://login.salesforce.com/services/Soap/u/21.0 as user chuck@paasnational.com
2011-05-12 22:06:21,637 INFO  [SFuserNamesToSQLtestusers] dao.DataAccessObjectFactory getDaoInstance (DataAccessObjectFactory.java:51) - Instantiating data access object: updateTestusers of type: databaseWrite
2011-05-12 22:06:21,641 INFO  [SFuserNamesToSQLtestusers] xml.XmlBeanDefinitionReader loadBeanDefinitions (XmlBeanDefinitionReader.java:163) - Loading XML bean definitions from file [C:\Program Files\salesforce.com\Apex Data Loader 21.0\bin\..\PAASPORTconf\database-conf.xml]
2011-05-12 22:06:21,674 FATAL [SFuserNamesToSQLtestusers] controller.Controller createDao (Controller.java:172) - Error creating data access object
org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name 'sqlServerDataSource' defined in file [C:\Program Files\salesforce.com\Apex Data Loader 21.0\bin\..\PAASPORTconf\database-conf.xml]: Bean class [com.microsoft.sqlserver.jdbc.sqlserverdatasource] not found; nested exception is java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.sqlserverdatasource
java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.sqlserverdatasource
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:108)
at org.springframework.beans.factory.support.BeanDefinitionReaderUtils.createBeanDefinition(BeanDefinitionReaderUtils.java:65)
at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement(DefaultXmlBeanDefinitionParser.java:426)
at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement(DefaultXmlBeanDefinitionParser.java:392)
at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitions(DefaultXmlBeanDefinitionParser.java:307)
at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.registerBeanDefinitions(DefaultXmlBeanDefinitionParser.java:191)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:295)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:223)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:173)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:148)
at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:68)
at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:56)
at com.salesforce.dataloader.dao.database.DatabaseConfig.getInstance(DatabaseConfig.java:22)
at com.salesforce.dataloader.dao.database.DatabaseWriter.<init>(DatabaseWriter.java:74)
at com.salesforce.dataloader.dao.database.DatabaseWriter.<init>(DatabaseWriter.java:58)
at com.salesforce.dataloader.dao.DataAccessObjectFactory.getDaoInstance(DataAccessObjectFactory.java:60)
at com.salesforce.dataloader.controller.Controller.createDao(Controller.java:170)
at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:104)
at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:74)
at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.java:226)
2011-05-12 22:06:21,705 FATAL [main] process.ProcessRunner topLevelError (ProcessRunner.java:211) - Unable to run process SFuserNamesToSQLtestusers
java.lang.RuntimeException: com.salesforce.dataloader.exception.DataAccessObjectInitializationException: Error creating data access object
at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:136)
at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:74)
at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.java:226)
Caused by: com.salesforce.dataloader.exception.DataAccessObjectInitializationException: Error creating data access object
at com.salesforce.dataloader.controller.Controller.createDao(Controller.java:173)
at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:104)
... 2 more
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name 'sqlServerDataSource' defined in file [C:\Program Files\salesforce.com\Apex Data Loader 21.0\bin\..\PAASPORTconf\database-conf.xml]: Bean class [com.microsoft.sqlserver.jdbc.sqlserverdatasource] not found; nested exception is java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.sqlserverdatasource
at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement(DefaultXmlBeanDefinitionParser.java:485)
at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement(DefaultXmlBeanDefinitionParser.java:392)
at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitions(DefaultXmlBeanDefinitionParser.java:307)
at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.registerBeanDefinitions(DefaultXmlBeanDefinitionParser.java:191)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:295)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:223)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:173)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:148)
at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:68)
at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:56)
at com.salesforce.dataloader.dao.database.DatabaseConfig.getInstance(DatabaseConfig.java:22)
at com.salesforce.dataloader.dao.database.DatabaseWriter.<init>(DatabaseWriter.java:74)
at com.salesforce.dataloader.dao.database.DatabaseWriter.<init>(DatabaseWriter.java:58)
at com.salesforce.dataloader.dao.DataAccessObjectFactory.getDaoInstance(DataAccessObjectFactory.java:60)
at com.salesforce.dataloader.controller.Controller.createDao(Controller.java:170)
... 3 more
Caused by: java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.sqlserverdatasource
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:108)
at org.springframework.beans.factory.support.BeanDefinitionReaderUtils.createBeanDefinition(BeanDefinitionReaderUtils.java:65)
at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement(DefaultXmlBeanDefinitionParser.java:426)
... 17 more
********************************************************************
Thanks, in advance, to anyone who helps!
Best Answer chosen by Moderator (salesforce.com) 
Jotham FisherSmithJotham FisherSmith
To fix the Apex Data Loader JDBC Class Not Found error for MS SqlServer:

Try configuring your data source bean using::
<bean id="dbDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
 <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>

Try adding the path to your JDBC Driver 3.0 sqljdbc.jar file to the classpath in the apex dataloader process.bat file (located in the apex dataloader bin directory).
Example: copy the jar file to the Apex Data Loader 21.0 root directory then edit the command line in the process.bat file::
..\_jvm\bin\java.exe -cp ..\sqljdbc.jar;..\DataLoader.jar -Dsalesforce.config.dir=%1 com.salesforce.dataloader.process.ProcessRunner %PROCESS_OPTION%

To use the jdbc driver with integrated security:
Try copying the sqljdbc_auth.dll from JDBC Driver 3.0\auth to  \Apex Data Loader 21.0\_jvm\bin
Use a single entry for the url property (looks like you may have two)

Hope that helps!

All Answers

Matt BrownMatt Brown
You are going to have to post this on the Developer Discussion Boards I am afraid as this is a technical questions that will get answered in that forum. http://boards.developerforce.com/sforce?category.id=developers
API AutomationAPI Automation
 OK, I will submit to the Developers Discussio board. Thanks, mattybme1!
Jotham FisherSmithJotham FisherSmith
To fix the Apex Data Loader JDBC Class Not Found error for MS SqlServer:

Try configuring your data source bean using::
<bean id="dbDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
 <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>

Try adding the path to your JDBC Driver 3.0 sqljdbc.jar file to the classpath in the apex dataloader process.bat file (located in the apex dataloader bin directory).
Example: copy the jar file to the Apex Data Loader 21.0 root directory then edit the command line in the process.bat file::
..\_jvm\bin\java.exe -cp ..\sqljdbc.jar;..\DataLoader.jar -Dsalesforce.config.dir=%1 com.salesforce.dataloader.process.ProcessRunner %PROCESS_OPTION%

To use the jdbc driver with integrated security:
Try copying the sqljdbc_auth.dll from JDBC Driver 3.0\auth to  \Apex Data Loader 21.0\_jvm\bin
Use a single entry for the url property (looks like you may have two)

Hope that helps!
This was selected as the best answer
API AutomationAPI Automation
Thanks, Jotham!

Putting the sqljdbc.jar in the specified directory fixed the problem. I appreciate your help.