• Nilove
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 4
    Replies

hi,

 

I am trying to Load data from Salesforce into SQL Server 2005 using command line. Here are my settings for SQL Server in database-conf file

 

----------------------------------

 

        <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
        <property name="url" value="jdbc:sqlserver://MyServerName:1433:databasename=MyDatabase;"/>

 

----------------------------------

I have installed MSSQL Server jdbc2.0 on my machine at this location

 

"C:\Program Files\Microsoft SQL Server 2005 JDBC Driver\sqljdbc_2.0\enu"

 

 

 

When I run the integration it gives me following error.

 

**************************************

 

2438 [AccountExtractDB] ERROR com.salesforce.lexiloader.dao.database.DatabaseCon
text  - Database error encountered during connecting for database configuration:
 DBAccountInsert.  Sql error: Cannot load JDBC driver class 'com.microsoft.sqlse
rver.jdbc.SQLServerDriver'.
org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.m
icrosoft.sqlserver.jdbc.SQLServerDriver'
        at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
rce.java:766)
        at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource
.java:540)
        at com.salesforce.lexiloader.dao.database.DatabaseContext.initConnection
(DatabaseContext.java:89)
        at com.salesforce.lexiloader.dao.database.DatabaseContext.checkConnectio
n(DatabaseContext.java:81)
        at com.salesforce.lexiloader.dao.database.DatabaseWriter.checkConnection
(DatabaseWriter.java:92)
        at com.salesforce.lexiloader.process.ProcessRunner.run(ProcessRunner.jav
a:121)
        at com.salesforce.lexiloader.process.ProcessRunner.main(ProcessRunner.ja
va:228)
Caused by: java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLSer
verDriver
        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:164)
        at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
rce.java:760)
        ... 6 more
2485 [AccountExtractDB] FATAL com.salesforce.lexiloader.process.ProcessRunner  -
 Database error encountered during connecting for database configuration: DBAcco
untInsert.  Sql error: Cannot load JDBC driver class 'com.microsoft.sqlserver.jd
bc.SQLServerDriver'.
Exception in thread "main" java.lang.RuntimeException: com.salesforce.lexiloader
.exception.DataAccessObjectInitializationException: Database error encountered d
uring connecting for database configuration: DBAccountInsert.  Sql error: Cannot
 load JDBC driver class 'com.microsoft.sqlserver.jdbc.SQLServerDriver'.
        at com.salesforce.lexiloader.process.ProcessRunner.run(ProcessRunner.jav
a:154)
        at com.salesforce.lexiloader.process.ProcessRunner.main(ProcessRunner.ja
va:228)
Caused by: com.salesforce.lexiloader.exception.DataAccessObjectInitializationExc
eption: Database error encountered during connecting for database configuration:
 DBAccountInsert.  Sql error: Cannot load JDBC driver class 'com.microsoft.sqlse
rver.jdbc.SQLServerDriver'.
        at com.salesforce.lexiloader.dao.database.DatabaseContext.initConnection
(DatabaseContext.java:97)
        at com.salesforce.lexiloader.dao.database.DatabaseContext.checkConnectio
n(DatabaseContext.java:81)
        at com.salesforce.lexiloader.dao.database.DatabaseWriter.checkConnection
(DatabaseWriter.java:92)
        at com.salesforce.lexiloader.process.ProcessRunner.run(ProcessRunner.jav
a:121)
        ... 1 more
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver c
lass 'com.microsoft.sqlserver.jdbc.SQLServerDriver'
        at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
rce.java:766)
        at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource
.java:540)
        at com.salesforce.lexiloader.dao.database.DatabaseContext.initConnection
(DatabaseContext.java:89)
        ... 4 more
Caused by: java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLSer
verDriver
        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:164)
        at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
rce.java:760)
        ... 6 more
Press any key to continue . . .

 

**************************************

 

Expecting a positive response from this forum :smileyhappy:

 

Nilove

Hi,

 

I'm newbie to salesforce.com.

I'm trying to export data from salesforce.com to SQL Server 2005 through

the Apex Data Loader.

When I run the process through command line I get this error:

FATAL [databaseExportAccountVeryShort] controller.Controller createDao (Controller.java:186) - Error creating data access object

Here is my database-conf.xml:

 

<!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.sqlserver.jdbc.SQLServerDriver"/>
    <property name="url" value="jdbc:sqlserver://Localhost:1433;databaseName=MyDatabase;"/>
    <property name="username" value="MyUser"/>
    <property name="password" value="MyPassword"/>
  </bean>
  <bean id="Account_DataLoader"
      class="com.salesforce.lexiloader.dao.database.DatabaseConfig"
      singleton="true">
    <property name="sqlConfig" ref="insertAccountVeryShort"/>
    <property name="dataSource" ref="dbDataSource"/>
  </bean>
  <bean id="insertAccountVeryShort"
      class="com.salesforce.lexiloader.dao.database.SqlConfig" singleton="true">
    <property name="sqlString">
        <value>
            INSERT INTO dbo.Account_DataLoader (Id,Account_Open_Date__c)
            VALUES (@Id@, @Account_Open_Date__c@)
        </value>
    </property>
    <property name="sqlParams">
        <map>
            <entry key="Id" value="java.lang.String"/>
            <entry key="Account_Open_Date__c"  value="java.lang.String"/>
        </map>
    </property>
  </bean>
</beans>

 

I have a matching part in process-conf.xml with dataAccess.type=databaseWrite

and in my command line the process name is insertAccountVeryShort.

 

Can anyone help me with that?

 

Thanks,

Omshi.

  • June 26, 2009
  • Like
  • 0
Hi,
 
I want to use the Apex Data Loader ( version 9.0 ) command line interface to get information from a SQL server 2000 db and import it into salesforce.  So far I've managed to successfully import from a csv using the command line ( and the process-conf.xml ).  But to connect to my SQL server database I need to know which driver to use ( I'm not a java programmer ).  I've looked about and the driver seems to be
 com.sun.sql.jdbc.sqlserver.SQLServerDriver
 
But when I use this I get the error 
 
ERROR com.salesforce.lexiloader.dao.database.DatabaseContext  - Database error encountered during connecting for database configuration: queryNewCustomers.  Sql error: Cannot load JDBC
driver class 'com.sun.sql.jdbc.sqlserver.SQLServerDriver'.
org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.sun.sql.jdbc.sqlserver.SQLServerDriver'
 at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:766)
 at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
 at com.salesforce.lexiloader.dao.database.DatabaseContext.initConnection(DatabaseContext.java:89)
 at com.salesforce.lexiloader.dao.database.DatabaseContext.checkConnection(DatabaseContext.java:81)
 at com.salesforce.lexiloader.dao.database.DatabaseReader.checkConnection(DatabaseReader.java:231)
 at com.salesforce.lexiloader.process.ProcessRunner.run(ProcessRunner.java:121)
 at com.salesforce.lexiloader.process.ProcessRunner.main(ProcessRunner.java:228)
 
Is there something I'm missing - a driver, installation, location of class file etc?  I
downloaded the Microsoft SQL Server 2005 JDBC Driver 1.1, a Type 4 JDBC driver that provides database connectivity through the standard JDBC application program interfaces (APIs) available in J2EE (Java2 Enterprise Edition), but don't know if I have to do something further to use this??
 
Any help would be great!
 
Sandra