Connecting Sql Server from Machine Task

All,

Is there is a way we can connect Sql Server from Machine task. We are getting an error.

<?xml version="1.0" encoding="UTF-8"?>
<config charset="UTF-8">
    <datastore-connection url="jdbc:sqlserver://xyz.server.net;databaseName=RPAMIS;"
                          username="username"
                          password="password" >                
        <var-def name="result">                  
            <datastore name="TBL_PROCESS">
                select * from TBL_PROCESS;
            </datastore>
        </var-def>     
    </datastore-connection>
</config>

Error:

Failed to execute query: select * from TBL_PROCESS;com.freedomoss.crowdcontrol.webharvest.plugin.datastore.exception.DataStoreProcessingException: Failed to execute query: select * from TBL_PROCESS; at com.freedomoss.crowdcontrol.webharvest.plugin.datastore.DataStorePlugin.executeQuery(DataStorePlugin.java:78) at com.freedomoss.crowdcontrol.webharvest.plugin.datastore.DataStorePlugin.executePlugin(DataStorePlugin.java:59) at org.webharvest.runtime.processors.WebHarvestPlugin.execute(WebHarvestPlugin.java:125) at org.webharvest.runtime.processors.BaseProcessor.run(BaseProcessor.java:127) at org.webharvest.runtime.processors.BodyProcessor.execute(BodyProcessor.java:27) at org.webharvest.runtime.processors.VarDefProcessor.execute(VarDefProcessor.java:59) at org.webharvest.runtime.processors.BaseProcessor.run(BaseProcessor.java:127) at org.webharvest.runtime.processors.BodyProcessor.execute(BodyProcessor.java:27) at org.webharvest.runtime.processors.WebHarvestPlugin.executeBody(WebHarvestPlugin.java:246) at com.freedomoss.crowdcontrol.webharvest.plugin.datastore.DataStoreConnectionPlugin.executePlugin(DataStoreConnectionPlugin.java:41) at org.webharvest.runtime.processors.WebHarvestPlugin.execute(WebHarvestPlugin.java:125) at org.webharvest.runtime.processors.BaseProcessor.run(BaseProcessor.java:127) at org.webharvest.runtime.Scraper.execute(Scraper.java:169) at org.webharvest.runtime.Scraper.execute(Scraper.java:182) at com.freedomoss.crowdcontrol.webharvest.executor.LocalWebharvestTaskExecutor.executeWebHarvestTask(LocalWebharvestTaskExecutor.java:171) at com.freedomoss.crowdcontrol.webharvest.executor.LocalWebharvestTaskExecutor.executeWebHarvestTask(LocalWebharvestTaskExecutor.java:94) at com.freedomoss.crowdcontrol.webharvest.SubmissionsPortionExecutionThread.processSubmissions(SubmissionsPortionExecutionThread.java:186) at com.freedomoss.crowdcontrol.webharvest.SubmissionsPortionExecutionThread.run(SubmissionsPortionExecutionThread.java:143) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: org.postgresql.util.PSQLException: ERROR: relation “tbl_process” does not exist Position: 15 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2198) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1927) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:561) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:405) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:397) at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264) at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264) at com.freedomoss.crowdcontrol.webharvest.plugin.datastore.service.DatabaseDataStoreService.executeSelectQuery(DatabaseDataStoreService.java:76) at com.freedomoss.crowdcontrol.webharvest.plugin.datastore.service.DatabaseDataStoreService.executeSelectQuery(DatabaseDataStoreService.java:54) at com.freedomoss.crowdcontrol.webharvest.plugin.datastore.DataStorePlugin.executeSelectQuery(DataStorePlugin.java:87) at com.freedomoss.crowdcontrol.webharvest.plugin.datastore.DataStorePlugin.executeQuery(DataStorePlugin.java:70) … 20 more

@venkateswaran.mrithinjayan,

Your example has 2 issues:

1 - If you want to connect to an external database, you need to use the <database> plugin - http://web-harvest.sourceforge.net/manual.php#database

<datastore-connection> plugin is used to connect to external datastores only, which are PostgreSQL dbs with special structure (ds_ table prefixes, etc)

2 - you are using MS SQL Server and therefore need to provide a parameter with a proper driver (jdbcclass)

See this topic with complete instructions - Connecting to MS SQL server