PL/SQL (MOSC)

MOSC Banner

Oracle Java stored procedure call dos batch

edited Oct 21, 2014 10:00AM in PL/SQL (MOSC) 1 commentAnswered

Oracle Java stored procedure to run a dos batch file using Java ProcessBuilder.  The dos batch output wont return or captured. Code:

            ProcessBuilder builder = new ProcessBuilder(batchFile);

            builder.redirectErrorStream(true);

            Process proc = builder.start();

            BufferedReader stdInput = new BufferedReader(new InputStreamReader(proc.getInputStream()));

            FileLog.log("====== Batch file std output started at " + dateString);
            while ((tmpStr = stdInput.readLine()) != null) {
                FileLog.log(tmpStr);
            }

Running the java code outside database, everything works just fine, but called thru sqlplus, the standout and error output won't log into the file.

Please help. Anyone had the same issue?

Thanks

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center