No suitable driver (JAVA program using DB2)

Advertisement

abdaizs
Joined:
Posts:
3
Location:
Budapest

No suitable driver (JAVA program using DB2)

Hi all,

I have a problem.
I have a shell script, which is calling a java program. (using DB2 in background)
In putty, it works, but in when I tried to call it in WinSCP, i have an error message. The driver is given in sh with FULL path, also it can not be wrong, however it works, when I tried in console window.


* 2009-04-10 10:59:30.809 (ETerminal) Command './export.sh'
* 2009-04-10 10:59:30.809 failed with return code 0 and error message
* 2009-04-10 10:59:30.809 java.sql.SQLException: No suitable driver

Can anybody help for me, what am i doing wrong?

Thx, for help!

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,517
Location:
Prague, Czechia

Re: No suitable driver (JAVA program using DB2)

Your script probably relies on some environment variables. These maybe set from startup script that is not executed for non-interactive sessions (WinSCP).

Reply with quote

abdaizs
Joined:
Posts:
3
Location:
Budapest

Re: No suitable driver (JAVA program using DB2)

Hi,

Thanks for the answer.
The sh file contains a following line:

/usr/lib/java/jre/bin/java -cp importer.jar:/opt/STS/Import/db2java.zip hu.Export

So java and db2java.zip is definied with full path, without any environment variables. I have changed a shell on Suse Linux to Bash 3.2, before the changing, the winscp script worked.

Don't you have any other idea?


Thx,
Zsolt


martin wrote:

Your script probably relies on some environment variables. These maybe set from startup script that is not executed for non-interactive sessions (WinSCP).

Reply with quote

martin
Site Admin
martin avatar

Re: No suitable driver (JAVA program using DB2)

OK, but the Java itself or the package you are executing may depend on environment variables.

Reply with quote

Advertisement

You can post new topics in this forum