Execute Java from PHP (Classpath problem?)

Hi,
I'm trying to execute a java application (just a few classes really), using PHP (so the app can be executed by the click of a button on a webpage). It is an Apache server running on windows.
The code to execute the java from the webpage is as follows...
<?php
echo "<pre>> EXECUTING...</pre>";
$output = shell_exec('java UpdateStock');
echo "<pre>$output</pre>";
?>However, I get this error.
java.lang.ClassNotFoundException: com.mysql.jdbc.DriverThe class runs fine from the command line (it's all setup using the typical classpath method), so I suspect its something to do with the server's configuration and not being able to find the drivers. How do I point the server-based app to the mysql drivers?
Many thanks for your help
Edited by: chezza on Nov 13, 2008 3:04 AM

Is it that your CLASSPATH has to be a system variable, and you've got it setup as a user variable... and the tomcat service runs as the "system" user, so it knows not your kinky CLASSPATH.
To totally avert such problems allways execute every java app you ever run with the -classpath (or -cp ?1.5? or later) switch... including those you launch from php.
BTW... The [PHP Java Bridge|http://php-java-bridge.sourceforge.net/pjb/installation.php] might be an option for you.

Similar Messages

  • Can't execute java from prompt command. . .

    hello!
    that's the following:
    I'm trying to execute
    "java Teste.class "
    from prompt command and it throws:
    Exceptio in thread "main" java.lang.NoClassDefFoundError
    in thread main. The Teste.java file is compiled finely using
    "javac Teste.java"
    My enviroment variables are cofigured this way:
    NAME: JAVA_HOME VALUE: C:\Arquivos de programas\Java\jdk1.5.0_03
    NAME: PATH VALUE: C:\Arquivos de programas\Java\jre1.5.0_03\bin
    NAME: CLASSPATH VALUE: C:\Arquivos de programas\Java\jre1.5.0_03\lib
    the vm and jdk directory is this:
    C:\Arquivos de programas\Java\jdk1.5.0_03
    C:\Arquivos de programas\Java\jre1.5.0_03
    and the Teste.java is:
    package teste;
    public class Teste{
        public Teste(){
            System.out.println("Testando, Testando, Testando");         
        public static void main(String[] args){
            Teste exe = new Teste();
    }So if you have any suggestion, please post it. Thanks!!

    Soneca,
    You're a complete idiot.
    Along with crossposting every question you have you often respond like this in threads. Just a complete jacka$$.
    I'll be sure to ignore you in future other than to point out your crossposts when I find them of course.
    This previous thread of yours (cross posted as always [in 4 forums!!!]) really is demonstrative of the fundamental deepness of your nitwittery
    http://forum.java.sun.com/thread.jspa?threadID=764824

  • Can't execute java from prompt command on xp. . .

    hello!
    that's the following:
    I'm trying to execute
    "java Teste.class "
    from prompt command and it throws:
    Exceptio in thread "main" java.lang.NoClassDefFoundError
    in thread main. The Teste.java file is compiled finely using
    "javac Teste.java"
    My enviroment variables are cofigured this way:
    NAME: JAVA_HOME VALUE: C:\Arquivos de programas\Java\jdk1.5.0_03
    NAME: PATH VALUE: C:\Arquivos de programas\Java\jre1.5.0_03\bin
    NAME: CLASSPATH VALUE: C:\Arquivos de programas\Java\jre1.5.0_03\lib
    the vm and jdk directory is this:
    C:\Arquivos de programas\Java\jdk1.5.0_03
    C:\Arquivos de programas\Java\jre1.5.0_03
    and the Teste.java is:
    package teste;
    public class Teste{
        public Teste(){
            System.out.println("Testando, Testando, Testando");         
        public static void main(String[] args){
            Teste exe = new Teste();
    }So if you have any suggestion, please post it. Thanks!!

    try
    java -cp <Location_of_Teste.class> Teste
    Message was edited by:
    sssow
    Message was edited by:
    sssow

  • Executing java from unix shell script

    Hi, I am trying to execute java program from a unix shell script and the program has a command line parameter. I have tried in ways like
    /opt/java1.4/bin/java CollExtractLoadProcess /home/inbox/archive/file_name
    /opt/java1.4/bin/java CollExtractLoadProcess "/home/inbox/archive/file_name"
    /opt/java1.4/bin/java CollExtractLoadProcess '/home/inbox/archive/file_name'
    /opt/java1.4/bin/java CollExtractLoadProcess file_name
    No matter how I execute it gives me the following error
    Exception in thread "main" java.lang.ClassFormatError: CollExtractLoadProcess (C
    ode segment has wrong length)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
    3)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
    Could someone please let me know what is the correct way of doing this?
    Thanks.

    Sounds like you either have a corrupt class file or you're using an older version of the JVM to try to execute classe that were compiled for a newer version.

  • Java.security.AccessControlException when executing java from the DB

    Hello
    I'm running a Oracle 10.1.0.3.0 on Linux
    I'm having trouble with executing some java code from the DB.
    I created following java stored procedure used to create the directory given by the parameter
    package be.vlaamsparlement.dis.os_commands;
    import java.io.*;
    import java.lang.*;
    import java.sql.*;
    import java.util.*;
    public class ManageOSDirectory {
    public static String createDir(String directoryName) throws Exception
    if ((new File(directoryName)).mkdirs())
    { return ("TRUE");}
    else
    { return ("FALSE");}
    Wrapped it in a pl/sql procedure an execute it as follows under DB schema DIS :
    begin
    declare
    b boolean;
    begin
    b := pck$os_commands.CreateDir('/data/files/vp_docs/schv/2004-2005/jan/1/');
    end;
    end;
    Where /data/files/vp_docs/schv/ already exist, so the proc needs to create the direcories '2004-2005', 'jan' and '1'
    this gives me following error :
    ORA-29532: Java call terminated by uncaught Java exception: java.security.AccessControlException:
    the Permission (java.io.FilePermission /data/files/vp_docs/schv/2004-2005/month/1 write) has not been granted to DIS.
    The PL/SQL to grant this is dbms_java.grant_permission( 'DIS', 'SYS:java.io.FilePermission', '/data/files/vp_docs/schv/2004-2005/jan/1', 'write' )
    I can't give this permission as the given directory does not yet exist. File permissions on os are ok and when i execute
    the code on the os (not from the DB) it works fine.
    This also worked on a Windows 10G DB without any extra grants.
    Also, i can execute the followint
    b := pck$os_commands.CreateDir('/data/files/vp_docs/schv/2004-2005/');
    but if i then execute
    b := pck$os_commands.CreateDir('/data/files/vp_docs/schv/2004-2005/jan/');
    I get the same error. So i can only creaet 1 directory beneath the schv directory
    Any ideas anyone ?

    The Error message is right.
    You need to:
    Ensure the Directory exist in Unix.
    Create the Directory in the Database as SYS.
    Grant Read,Write permission on th DIrectory to DIS
    Grant Java permission on th DIrectory to DIS (using the syntax already shown in the Error message).
    See my example below (10g R1)
    SQL> connect /as sysdba
    Connected.
    SQL> GRANT CONNECT,RESOURCE TO DIS IDENTIFIED BY DIS;
    Grant succeeded.
    SQL> create or replace directory DIS_DOWNLOAD_DIR as '/data/files/vp_docs/schv/2004-2005/month/1';
    Directory created.
    SQL> col DIRECTORY_PATH format a50
    SQL> select * from dba_directories;
    OWNER DIRECTORY_NAME DIRECTORY_PATH
    SYS DIS_DOWNLOAD_DIR /data/files/vp_docs/schv/2004-2005/month/1
    1 row selected.
    SQL> GRANT READ,WRITE ON DIRECTORY "SYS"."DIS_DOWNLOAD_DIR" TO "DIS";
    Grant succeeded.
    SQL> EXECUTE DBMS_JAVA.GRANT_PERMISSION( 'DIS', 'SYS:java.io.FilePermission', '/data/files/vp_docs/schv/2004-2005/jan/1', 'write' )
    2 /
    PL/SQL procedure successfully completed.
    SQL>

  • [SOLVED] Executing bash from php.

    Hey guys,
    So I have this bash script in /opt/scripts.  So this script runs perfectly now by asking for two inputs from the user and doing a variety of script installs.  However now i'm being asked to make a php page that will work with this script.  So my question is is there better way to execute a root script from a user level php page.  For instance I am testing the php page with this.
    if($submitted){
                    // Show em for troubleshooting reasons
                    echo "domain: $d  |  name: $n";
    So when I go to the page it shows and put in inputs it will echo the proper variables.  So I know it's assigning the variables correctly.  I'm just not 100% on how I can pass them from a php environment into a bash environment. I am trying to use something like this.
    <?php
      if (!empty($_POST)) {
        exec('sh /path/to/shell ' . $_POST['var1'] . ' '  . $_POST['var2'] . ' '  . $_POST['var3']);
    ?>
    However it doesn't seem to want to execute?
    Last edited by hauntedbyshadow (2014-07-21 12:41:07)

    First, thanks Trilby I didn't realize there were 'code tags' till after the post, so i'll use them from now on... so there are no actual error logs because it's not on a development server just yet.  As of now i'm just doing testing on seeing how it's even done. 
    echo 'sh /path/to/shell ' . $_POST['var1'] . ' ' . $_POST['var2'] . ' ' . $_POST['var3'];
    Did actually work however still unsure of if it will execute properly when using a root level script.  Should I be setting the script to user level, or having the php page fire in a sudo format or something.  I'm not entirely sure.

  • Accessing Java HttpServer from PHP;

    Hello all,
    I have created an httpserver using 'com.sun.net.httpserver'. Everything works fine except one thing.
    When i make this simple call from PHP (http://localhost:8081/something outputs an XML file):-
    $url = 'http://localhost:8081/something'; 
    $xml = simplexml_load_file($url); 
    print_r($xml); Nothing appears and it times out after sometime.
    However, while the browser is 'trying' to get the result (from PHP file) if i 'stop' my HttpServer (Java) the result suddenly appears. I am very sure i close all the streams i opened. Does anyone have any idea?
    Thanks
    Neville

    So on doing some debugging i realized that the http thread that started executing may have not exited correctly. That may explain the fact that when i shut the java server down explicitly while the 'php' code waits for some response, the response suddenly appears.
    While creating the server i am using:-
    server.setExecutor(Executors.newCachedThreadPool());In ThreadPoolExecutor.class
    Runnable getTask() { ....
    if (state == SHUTDOWN)  // Help drain queue
        r = workQueue.poll();
    else if (poolSize > corePoolSize || allowCoreThreadTimeOut)
        r = workQueue.poll(keepAliveTime, TimeUnit.NANOSECONDS);
    else
       r = workQueue.take();
    if (r != null)
        return r;
    if (workerCanExit()) {
    ...Using the debugger tool took me to the class ThreadPoolExecutor.class which seems to be the bottleneck; This condition is true (poolSize > corePoolSize || allowCoreThreadTimeOut(=false)) and it starts polling. I think maybe this is causing the problem and if it exited maybe the result would appear. Even if the corePoolSize is more than poolsize it seems to be getting stuck in r = workQueue.take();.
    I dont know how it works ok with a browser but hangs when PHP request comes into the picture. Strange...
    Thanks
    Neville

  • Execute java class from a batch file called from runtime.exec

    Hi.
    I don´t know if this question fits here.
    I wan´t to execute a batch file (on Win XP) with runtime.exec. That batch file will execute another java program.
    I have the following code:
    Resolutor.java
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    public class Resolutor {
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              Runtime r = Runtime.getRuntime();
              //String[] command = { "cmd.exe", "/C",".\\lanzar.bat .\\ .\\ 001.res:001.dtt" };
              String[] command = { "cmd.exe", "/C",".\\tarea\\lanzar.bat " + args[0] + " " + args[1] + " " + args[2]};
              try {
                   //Process proceso = Runtime.getRuntime().exec("lanzar.bat");
                   Process proceso = Runtime.getRuntime().exec(command);
                   InputStream stderr = proceso.getErrorStream();
                InputStreamReader isr = new InputStreamReader(stderr);
                BufferedReader br = new BufferedReader(isr);
                String line = null;
                System.out.println("<ERROR>");
                while ( (line = br.readLine()) != null)
                    System.out.println(line);
                System.out.println("</ERROR>");
                   int exitVal = proceso.waitFor();
                   System.out.println("EXITVAL: " + exitVal);
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (InterruptedException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    }lanzar.bat
    java Lanzador %1 %2 %3Lanzador.java
    import java.util.Vector;
    public class Lanzador {
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              Repetitiva rpt=new Repetitiva();
              String rutaFicheros=args[0];
              String rutaResultado=args[1];
              String[] ficheros=args[2].split(":");
              Vector<String> ficheroDatos=new Vector<String>();
              for(int i=0;i<ficheros.length;i++){
                   ficheroDatos.add(ficheros);
                   System.out.println(ficheros[i]);
              System.out.println("RUTA DE FICHEROS: " + rutaFicheros);
              System.out.println("RUTA DE RESULTADOS: " + rutaResultado);
              System.out.println("CALCULAR");
              rpt.setRepetitiva(ficheroDatos, rutaFicheros, rutaResultado);
              rpt.calcular();
    }I´ve got Resolutor.class in /res and the other two files (and the rest of the files for running) in /res/tarea.
    If I execute /res/tarea/lanzar.bat from the command line everything works fine, it calls java and runs lanzador without problem.
    The problem comes when I try to execute the batch file via Resolutor.class. It executes the batch file without problem, but it throws a *java.lang.NoClassDefFoundError: Lanzador* when launching the new java application.
    Any ideas of how can I solve that problem. (It must do it via batch file).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Well, I tried putting in the bat file java -classpath .\tarea Lanzador %1 %2 %3 and didn´t work.
    I ve tried the bat modification, and the directory in x.txt is k:\res instead of k:\res\tarea.
    I´ve tried to modifiy it to java .\tarea\Lanzador and didn´t work so I have put a cd like the following and it appears to work.
    cd tarea
    java Lanzador %1 %2 %3Thanks for the replies.

  • How to upload a file from java to php

    hi
    i am trying to upload/send a file from client using swing/applet
    and receiving it with php code.
    here is the php code which uploads the post file from the client
    $uploaddir = "/home/raghavendra/Documents/";
    $file = basename( $_FILES["uploadedfile"]["name"]);
    echo "file:\n".$file;
    $uploadfile = $uploaddir. $file;
    if (move_uploaded_file($_FILES["uploadedfile"]["tmp_name"],$uploadfile)) {
    echo "File is valid, and was successfully uploaded.\n";
    else {
    echo "File upload failure Possible file upload attack!\n";
    and corresponding different java code which post the
    1)
    public void postmethodTest(String filefrom){
    try{
    String hostname = "localhost";
    int port = 80;
    InetAddress addr = InetAddress.getByName(hostname);
    Socket socket = new Socket(addr, port);
    // Send header
    String path ="/php_prgs/var/www/nsboxng/htdocs/tryupdate.php";
    File theFile = new File(filefrom);
    System.out.println ("size: " + (int) theFile.length());
    DataInputStream fis = new DataInputStream(new BufferedInputStream(new FileInputStream(theFile)));
    byte[] theData = new byte[(int) theFile.length( )];
    fis.readFully(theData);
    fis.close();
    DataOutputStream raw = new DataOutputStream(socket.getOutputStream());
    Writer wr = new OutputStreamWriter(raw);
    String command =
    "POST "+path+" HTTP/1.0\r\n"
    + "Content-type: multipart/form-data, boundary=mango\r\n"
    + "Content-length: " + ((int) theFile.length()) + "\r\n"
    + "\r\n"
    + "--mango\r\n"
    + "content-disposition: name=\"MAX_FILE_SIZE\"\r\n"
    + "\r\n"
    + "\r\n--mango\r\n"
    + "content-disposition: attachment; name=\"datafile\"" ;
    String filename="test.doc\"\r\n"
    + "Content-Type: text/doc\r\n"
    + "Content-Transfer-Encoding: binary\r\n"
    + "\r\n";
    wr.write(command);
    wr.flush();
    raw.write(theData);
    raw.flush( );
    wr.write("\r\n--mango--\r\n");
    wr.flush( );
    BufferedReader rd = new BufferedReader(new
    InputStreamReader(socket.getInputStream()));
    String line;
    while ((line = rd.readLine()) != null) {
    System.out.println("out"+line);
    wr.close();
    raw.close();
    socket.close();
    } catch (Exception e) {System.out.println(e.toString());}
    2)
    public void postMethod(String strURL, String filefrom){
    try {
    String fname = filefrom.substring(filefrom.lastIndexOf("/")+1, filefrom.length());
    File input=new File(filefrom);
    // Prepare HTTP post
    PostMethod post = new PostMethod(strURL);
    // Request content will be retrieved directly
    // from the input stream
    // Per default, the request content needs to be buffered
    // in order to determine its length.
    // Request body buffering can be avoided when
    // content length is explicitly specified
    post.setRequestEntity(new InputStreamRequestEntity(new FileInputStream(input), input.length()));
    // Specify content type and encoding
    // If content encoding is not explicitly specified
    // ISO-8859-1 is assumed
    //post.setRequestHeader("Content-type", "text/xml; charset=ISO-8859-1");
    post.setRequestHeader("Content-Type","multipart/form-data");
    post.setRequestHeader("Content-Disposition", "form-data; name="+fname);
    // Get HTTP client
    HttpClient httpclient = new HttpClient();
    // Execute request
    try {
    int result=httpclient.executeMethod(post);
    // Display status code
    System.out.println("Response status code: " +result);
    // Display response
    System.out.println("Response body: ");
    // System.out.println(post.getResponseBodyAsString());
    BufferedReader console = new BufferedReader(new InputStreamReader(post.getResponseBodyAsStream()));
    String name = null;
    String line = null;
    try {
    while ((line = console.readLine()) != null) {
    System.out.println("output"+line);
    //name = console.readLine();
    catch (IOException e) { name = "<" + e + ">"; }
    // System.out.println("Hello " + name);
    } finally {
    // Release current connection to the connection pool
    // once you are done
    post.releaseConnection();
    catch(IOException e){
    but am getting else condition response from php code
    but if i post with html code it is working fine.
    can anybody help me please where i have to change the code
    please suggest me. am in a big trouble and i have to complete this as soon as possible

    Jakarta Commons HttpClient
    ~

  • How to get data from php to java via xmlrpc

    I have been trying to get data from php through apache xmlrpc to java.
    I do get an value as result. The result is "Array". How how do i convert the XMLRPC Object "Array" to Java Object?
    Inside the XMLRPC "Array" Object there is object too of type Array from php.
    See code for java here
    Object result = client.execute( "blogger.getCategories", params1 );
    Code from php here
    function getCategories($appkey, $username, $password)
         global $xmlrpcerruser, $xmlrpcI4, $xmlrpcInt, $xmlrpcBoolean, $xmlrpcDouble, $xmlrpcString, $xmlrpcDateTime, $xmlrpcBase64, $xmlrpcArray, $xmlrpcStruct, $xmlrpcValue;
         $structArray = array();
         $structArray[] = new xmlrpcval(array("one" => "test"));
         return new xmlrpcresp(new xmlrpcval( $structArray , $xmlrpcArray));     
    I do get Standard String and Integer from php to Java through XMLRPC.
    Can someone help me.
    Edited by: Electron32 on Aug 13, 2010 9:44 AM

    That is what is so strange. I return an 'array' through xmlrpcval() and in Java I tried to cast it to ArrayList, Vector,String[] but get an error
    Object[] result = (Object[]) client.execute( "blogger.getCategories", params1 );
    String[] array = (String[]) result;
    Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.String;
            at com.dirdalit.window.Main.main(Main.java:41)
    Edited by: Electron32 on Aug 13, 2010 12:25 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Error while executing java stored procedure from a pl/sql procedure

    We have a requirement where we need to execute JAVA code stored in an Oracle database (Java Stored Procedure). This code uses some JAR files which we have already loaded without any errors in the database.
    The class file was also loaded in the database without any errors. But when we execute the method of this class (JAVA code), it gives the following error:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.NoClassDefFoundError
    Is there any way of debugging the code and getting to know where exactly the problem is? Or, any tool/software available for doing the same.
    Any pointers would be of great help!
    Thanks in advance

    Hi Uday,
    My guess is that there is a problem with your java stored procedure that is causing the "ExceptionInInitializer" error to be thrown. According to the javadoc:
    is thrown to indicate that an exception occurred during
    evaluation of a static initializer or
    the initializer for a static variable
    Since I didn't see any of your code in your post, I can't help you much more, I'm afraid. Perhaps if you would provide some more details, I may be able to help you some more. I think the following details would be helpful:
    1. Complete error message and stack trace you are getting.
    2. The section of your java code that you think is causing the problem.
    3. Oracle database version you are using.
    Good Luck,
    Avi.

  • Problem in generate Java  from PL SQL package in Jdeveloper

    Hi
    i have problem in create java class from PL SQL package in JDeveloper.
    I use Database navigator of jdeveloper and right click on a package and choose Generate Java then in Jpublisher window choose my view Controller and accept other default values.
    I call methods of generated class in the Action of a button in my JSP page, but when I click the button it  throw null pointer exception !!! i fund one of generated method return null and it lead to this exception.
    protected DefaultContext __tx = null;
    public DefaultContext getConnectionContext() throws SQLException  {
    if (__tx==null){
    __tx = (getConnection()==null) ? DefaultContext.getDefaultContext() : new DefaultContext(getConnection());
        return __tx;
      public Connection getConnection() throws SQLException
        if (__onn!=null) return __onn;
         else if (__tx!=null) return __tx.getConnection();
         else if (__dataSource!=null) __onn= __dataSource.getConnection();
         return __onn;
    i try to generate class in Model project and create DataControl for that and use method action but noting change and i get null pointer again!!
    Jdeveloper Versino = 11.1.1.7.0

    Let me ask you another question: Why do you generate java from the package at all?
    Where do you want to call the package?
    Back to your question: you should see code like
        public void setDataSourceLocation(String dataSourceLocation) throws SQLException {
            javax.sql.DataSource dataSource;
            try {
                Class cls = Class.forName("javax.naming.InitialContext");
                Object ctx = cls.newInstance();
                java.lang.reflect.Method meth = cls.getMethod("lookup", new Class[] { String.class });
                dataSource = (javax.sql.DataSource) meth.invoke(ctx, new Object[] { "java:comp/env/" + dataSourceLocation });
                setDataSource(dataSource);
            } catch (Exception e) {
                throw new java.sql.SQLException("Error initializing DataSource at " + dataSourceLocation + ": " + e.getMessage());
    in the generated code. This code look up a datasource (which you have defined e.g. on the Weblogic Server) by calling the method
    setDataSourceLocaltion("jdbc/HRConnDS");
    This look up the datasource nad stores it in the class variable.
    Timo

  • How to create windows executable file from a java file. Please help.

    Hi,
    For my project I developed the codes in Java. It is working well with java run time environment. But without that I can not run it. I need to create a exe file (windows executable file) from the java source code. If you have any idea please share it with me.
    Even if you know it very lightly, please help with what you know. That would be a big help for me.
    Thank you very much.

    Does anybody know how to read a manual?
    Matt Richardson
    Certified LabVIEW Developer
    MSR Consulting, LLC

  • How to start an executable program from a java program ?

    Hi,
    does someone know how to start an executable program from a JAVA program ?
    Thanks, Fred.

    Take a look at the Runtime class.
    -S-

  • Execute ConcurrentRequest from java program

    In order to execute concurrent request from java program are this 3 lines enough :
    1)ConcurrentRequest concurrentrequest = new ConcurrentRequest(oadbtransaction.getJdbcConnection());
    2)int i = concurrentrequest.submitRequest("some value", " some value", "some value", null, false, vector);
    3)oadbtransaction.commit();
    *******************************8
    I am asking because while executing ConcRequest from PL/SQL I have to call a functin : fnd_global.apps_initialize(user_id ,resp_id, app_id) prior to executing FND_REQUEST.SUBMIT_REQUEST.
    Is there any equivalent in java for apps_initialize?
    thanks in advance.

    hi
    u can call the FND_global using callable statement
    DBTransaction txn = getDBTransaction();
    CallableStatement cs =
    txn.createCallableStatement("begin fnd_global.apps_initialize(:1, :2,:3);end;");
    try
    cs.setString(1, getOADBTransaction().getUserId() );
    cs.setString(2, getOADBTransaction().responsibilityId());
    cs.setString(3, getOADBTransaction().getApplicationID());
    cs.execute();
    cs.close();
    catch (SQLException sqle)
    try { cs.close } catch (Exception(e) {}
    throw OAException.wrapperException(sqle);
    thanx
    Pratap

Maybe you are looking for

  • Upgrading from Siebel 8.0.1.1 to 8.1.1.2

    Hey guys, I'm trying to upgrade my Siebel Application from 8.0.1.1 to 8.1.1.2 and I have found a site that recommends to download the patch 9318567 but when going to the Oracle Support site the platforms show Microsoft Windows(32-bit) We have our app

  • Finding the end of a document using Scanner

    I'm reading a file line by line, but cannot figure out how to read the end of a document without finding the number of lines in the document myself. When I have all of the lines printed out, I get an error at the end saying that no line could be foun

  • How do I copy a spreadsheet/table from one Pages document to paste to another?

    Hello: I am in graduate school and am working on an assignment that requires that I use two different 'templates,' or tables, to analyze data. Instead of filling them in separately and saving as multiple documents, I have created an assignment docume

  • Influence about system performance by RAL, SAL

    Hi, Experts. My team are going to use RAL(Read Access Log) and SAL(Security Audit Log) for logging users access to sensitive data. To meet the compliance, we have to log users' activity information as 5W1H(WHO, WHAT, HOW, WHEN, WHERE, WHY) principle.

  • F-32 Difference Postings with Special G/L indicators

    When we clear AR line items using F-32, and all the transactions we are clearing have the same Special G/L indicator, any difference posting generated does NOT get allocated to that Special G/L indicator, which is NOT what we want - e.g. if we clear