Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
Hi,
i have used,
Process p = Runtime.getRuntime().exec("cmd /c \"start sqlplus system/manager && CREATE OR REPLACE DIRECTORY export_dir AS 'E:\';\"");
application connected to oracle database successfully using command sqlplus system/manager. but second command CREATE OR REPLACE DIRECTORY export_dir AS 'E:\';
does not work as shown in Image attached. Plz let me know how to execute multiple commands on cmd.exe one by one . Please check syntax to run multiple commands in Process p = Runtime.getRuntime().exec("cmd /c \"start sqlplus system/manager && CREATE OR REPLACE DIRECTORY export_dir AS 'E:\';\"");
Thanks
Manoj
Hi Manoj,
why do you try in java to start sqlplus from the command windows? Wouldn't it be easier to call sqlplus directly from java?
I suppose you'll have to group your 2 main commands, so the start apply to them:
Process p = Runtime.getRuntime().exec("cmd /c \"start (sqlplus system/manager && CREATE OR REPLACE DIRECTORY export_dir AS 'E:\';) \"");
Loïc
Hello,
this is a new feature in java 9 and is not released till now.
Ciao
Leo