JAVA通过Runtime.getRuntime().exec(cmd)调用DB2命令 10
Runtime.getRuntime().exec("db2<<EOF");Runtime.getRuntime().exec("connecttodzdb");会报以下...
Runtime.getRuntime().exec("db2 <<EOF");
Runtime.getRuntime().exec("connect to dzdb");
会报以下错误:
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL1024N A database connection does not exist. SQLSTATE=08003
java.io.IOException: Cannot run program "connect": java.io.IOException: error=2, No such file or directory
在服务器上,直接执行db2 connect to dzdb 是可以连接的!!!!
Runtime.getRuntime().exec("db2 connect to dzdb"); 也是可以正常运行的。。
Runtime.getRuntime().exec("db2"); 也是可以运行的。。。但无法处理后续命令
但就是 Runtime.getRuntime().exec("db2 <<EOF");就不行了 展开
Runtime.getRuntime().exec("connect to dzdb");
会报以下错误:
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL1024N A database connection does not exist. SQLSTATE=08003
java.io.IOException: Cannot run program "connect": java.io.IOException: error=2, No such file or directory
在服务器上,直接执行db2 connect to dzdb 是可以连接的!!!!
Runtime.getRuntime().exec("db2 connect to dzdb"); 也是可以正常运行的。。
Runtime.getRuntime().exec("db2"); 也是可以运行的。。。但无法处理后续命令
但就是 Runtime.getRuntime().exec("db2 <<EOF");就不行了 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询