database connection do not work in a batch mode

Hi all.

I have a workflow which  works fine on my computer both in interactive and batch mode, but when i try it on other computer it fails in the batch mode. 

 I use the following command: 

knime.exe -nosplash -consoleLog  -application org.knime.product.KNIME_BATCH_APPLICATION -workflowDir="C:\Users\user\knime-workspace\myWorkflow" -reset

it returns: 

ERROR  KNIME-Worker-0 Database Connector  Execute failed: Could not create connection to database: com.microsoft.sqlserver.jdbc.SQLServerDriver

Additionaly Java reports: 

java was started but returned exit code=4...

Still in regular KNIME interface workflow is able to connect to DB without any problem. Any ideas what might be the reason and  how this can be helped?

Thanks!

P.S: On other computer I tried to run it via remote desktope connection if it matters. 

 

 

 

 

Hello Tatiana,

it seems the SQL server driver is missing on the computer you execute KNIME in batch mode. Either you ensure that the driver is in the same location as on your machine or you need to adapt the location of the driver in the preferences on the machine the execution fails.

Bye

Tobias

Hello Tobias, 

When I run workflow  from the normal  Knime inteface  (on the remote computer) the workflow  connects to the DB without any problems. So I guess the driver is present and working. 

Only the batch mode fails.

Can the location of the driver still be the problem? 

Bye, 

Tatiana.

 

 

Since custom database drivers are stored in the workspace preferences and the batch mode uses a different workspace (usually) you first need to export the preferences into a file and the pass this file on the command line to the batch executor using the -preferences argument.

Thanks a lot, it works now!