How to open a command prompt and input different commands from a java program

血红的双手。 提交于 2019-12-02 06:08:56
Pawan

You can use this exec public Process exec(String command) throws IOException

Also visit This Link

Instead of trying to run ij.bat, and feed it commands to run and parse the output, just have your program use the ij class, and its runScript method: http://db.apache.org/derby/docs/10.11/publishedapi/org/apache/derby/tools/ij.html#runScript-java.sql.Connection-java.io.InputStream-java.lang.String-java.io.OutputStream-java.lang.String-

Then you don't have to spawn a separate process, but can just keep everything in pure Java in your program itself.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!