Execute python within Oracle

André Lopes andrecrash3r at gmail.com
Fri Dec 9 12:12:01 EST 2011


Hi all,



   I wrote a simple Java program to be called within an Oracle database.
The goal is to execute a Python program within the DB itself, by the means
of a Java program. The problem is that when I execute the procedure inside
the DB, nothing happens…



   If I create the same Java class outside the DB and execute it, the
python program works perfectly, only inside the DB nothing happens. The
program is the following.



CREATE OR REPLACE AND COMPILE java source named "OSCommand" as

import java.io.*;

public class OSCommand{

public static void Run(){

try

        {

            Runtime r = Runtime.getRuntime();

            Process p = r.exec("cmd /c C:\\Python32\\python.exe
C:\\Ficheiros\\SAP\\Novos\\xls2csv.py
C:\\Ficheiros\\SAP\\Novos\\20111020_ListagemSAP.xlsx");



        }

        catch (Exception e)

        {

            e.printStackTrace();

        }

        }

}

/



   Can anyone help?



Thanks,

André
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20111209/146362d7/attachment-0001.html>


More information about the Python-list mailing list