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
TypoTypo 

Data Loader Command line--Data Access Bean for Microsoft SQL Server JDBC error: class not found

 

This is the DAO I tried to set up. Is there an error for the class? I downloaded the MS JDBC driver (tried both versions 2.0 and 3.0). I added a CLASSPATH to my enviroment variables. Tried moving the sqljdbc.jar to the root and changing the CLASSPATH. Still the bean does not seem to find the jdbc driver. The log is below with the first error bolded.
<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>

 

 

 

 

 

Loading XML bean definitions from file [C:\Program Files\salesforce.com\Apex Data Loader 21.0\bin\..\PAASPORTconf\database-conf.xml]

2011-05-12 20:51:14,891 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)

 

Best Answer chosen by Admin (Salesforce Developers) 
kxa422kxa422

In the file process.bat, check that your jdbc driver is present

 

 

From the line
..\_jvm\bin\java.exe -cp ..\DataLoader.jar -Dsalesforce.config.dir=%1 com.salesforce.dataloader.process.ProcessRunner %PROCESS_OPTION%

 

 

to be something like that

 

..\_jvm\bin\java.exe -cp "..\DataLoader.jar;jtds-1.2.2.jar" -Dsalesforce.config.dir=%1 com.salesforce.lexiloader.process.ProcessRunner %PROCESS_OPTION%

 

where jar;jtds-1.2.2.jar is the java package to link to SQL server