我们如何通过java执行此命令? [英] How do we execute this command through java?

查看:68
本文介绍了我们如何通过java执行此命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

db2 -t -v -f / home ... / filename> output_file-name


我有一个java存储过程..必须运行上面的

命令...不确定我如何通过java运行此命令..

任何建议都表示赞赏..

解决方案

technocrat写道:

db2 -t -v -f / home ... / filename> output_file-name
<我有一个java存储过程..它必须运行上面的命令...不知道我怎么能通过java运行这个命令..
任何建议都赞赏..



System.getRuntime()。exec(" ...");


-

Knut Stolze

DB2信息集成开发

IBM德国


看起来似乎没有getRuntime方法调用系统

class ...给我一个错误....任何帮助??


technocra t写道:

看起来似乎没有getRuntime方法调用系统
类...给我一个错误....任何帮助??




对,我的错误。然后使用Runtime类。


-

Knut Stolze

DB2信息集成开发

IBM德国


db2 -t -v -f/home.../filename >output_file-name

I have a java stored procedure..which has to run the above
command...not sure how i can run this command through java..
any suggestions are appreciated..

解决方案

technocrat wrote:

db2 -t -v -f/home.../filename >output_file-name

I have a java stored procedure..which has to run the above
command...not sure how i can run this command through java..
any suggestions are appreciated..



System.getRuntime().exec("...");

--
Knut Stolze
DB2 Information Integration Development
IBM Germany


Doesnt seem like getRuntime method call is present in System
class...gives me an error....any help??


technocrat wrote:

Doesnt seem like getRuntime method call is present in System
class...gives me an error....any help??



Right, my mistake. Then use the Runtime class.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany


这篇关于我们如何通过java执行此命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆