Java to process communication

Hello,
I have a bash script that is run by a java process. i want it to be able to communicate with the java thread that launched it, but not through its stdout (which i want to reserve for info messages). so i thought of using a pipe. how can this be done?

maybe i wasn't clear enough
the java process is an enterprise application, running multiple threades and launching many scripts in different threads. therefore, the cleanest approach is for each thread to create its own pipe. since afaik, this cannot be done in java, i'm stuck.
i can create a single named pipe before launching java, then have all scripts communicate through that, with some kind of synchronization, but this is very ugly and error prone

Similar Messages

  • Mysql error java.sql.SQLException: Communication failure during handshake.

    Hi !!!
    I was working ok, with hibernate and mysql but yesterday I try to install the new mysql version (4.1.10) and receive the following error when I try to connect
    Initializing Hibernate
    INFO - Hibernate 2.1.6
    INFO - hibernate.properties not found
    INFO - using CGLIB reflection optimizer
    INFO - configuring from resource: /hibernate.cfg.xml
    INFO - Configuration resource: /hibernate.cfg.xml
    INFO - Mapping resource: com/tutorial/hibernate/core/News.hbm.xml
    INFO - Mapping class: com.tutorial.hibernate.core.News -> news
    INFO - Configured SessionFactory: null
    INFO - processing one-to-many association mappings
    INFO - processing one-to-one association property references
    INFO - processing foreign key constraints
    INFO - Using dialect: net.sf.hibernate.dialect.MySQLDialect
    INFO - Maximim outer join fetch depth: 2
    INFO - Use outer join fetching: true
    INFO - Using Hibernate built-in connection pool (not for production use!)
    INFO - Hibernate connection pool size: 20
    INFO - using driver: org.gjt.mm.mysql.Driver at URL: jdbc:mysql://localhost/unnobanews
    INFO - connection properties: {user=news, password=news}
    INFO - Transaction strategy: net.sf.hibernate.transaction.JDBCTransactionFactory
    INFO - No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
    WARN - Could not obtain connection metadata
    java.sql.SQLException: Communication failure during handshake. Is there a server running on localhost:3306?
    at org.gjt.mm.mysql.MysqlIO.init(Unknown Source)
    at org.gjt.mm.mysql.Connection.connectionInit(Unknown Source)
    at org.gjt.mm.mysql.jdbc2.Connection.connectionInit(Unknown Source)
    at org.gjt.mm.mysql.Driver.connect(Unknown Source)
    at java.sql.DriverManager.getConnection(DriverManager.java:512)
    at java.sql.DriverManager.getConnection(DriverManager.java:140)
    Somewhere I red that was necessary to update the jdbc driver, so I updated it from version nro 2 to version nro 3.1.7 but still the error
    Phpmyadmin works ok and mysql control center can connect ok too.
    But when I try a telnet localhost:3306 I receive and error of connection filed
    Anyway the mysql status thowme correct information, that it working ok!
    Any idea ?
    King regards
    Naty

    Hibernate 2.1.6
    loaded properties from resource hibernate.properties: {hibernate.connection.username=root, hibernate.connection.password="", hibernate.cglib.use_reflection_optimizer=true, hibernate.connection.pool_size=10, hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect, hibernate.connection.url=jdbc:mysql://manoj/manoj, hibernate.connection.driver_class=org.gjt.mm.mysql.Driver}
    using CGLIB reflection optimizer
    configuring from resource: /hibernate.cfg.xml
    Configuration resource: /hibernate.cfg.xml
    Mapping resource: com/mec/emp.hbm.xml
    Mapping class: com.mec.Employee -> emp
    Configured SessionFactory: null
    processing one-to-many association mappings
    processing one-to-one association property references
    processing foreign key constraints
    Using dialect: net.sf.hibernate.dialect.MySQLDialect
    Maximim outer join fetch depth: 2
    Use outer join fetching: true
    Using Hibernate built-in connection pool (not for production use!)
    Hibernate connection pool size: 10
    using driver: org.gjt.mm.mysql.Driver at URL: jdbc:mysql://manoj/manoj
    connection properties: {user=root, password=""}
    No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
    Could not obtain connection metadata
    java.sql.SQLException: Server configuration denies access to data source
         at org.gjt.mm.mysql.MysqlIO.init(MysqlIO.java:144)
         at org.gjt.mm.mysql.Connection.<init>(Connection.java:230)
         at org.gjt.mm.mysql.Driver.connect(Driver.java:126)
         at java.sql.DriverManager.getConnection(DriverManager.java:525)
         at java.sql.DriverManager.getConnection(DriverManager.java:140)
         at net.sf.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:101)
         at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:73)
         at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1155)
         at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:789)
         at com.mec.CreateSession.getCurrentSession(CreateSession.java:35)
         at com.mec.TestEmployee.createEmployee(TestEmployee.java:37)
         at com.mec.TestEmployee.main(TestEmployee.java:24)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
    Use scrollable result sets: false
    Use JDBC3 getGeneratedKeys(): false
    Optimize cache for minimal puts: false
    Query language substitutions: {}
    cache provider: net.sf.hibernate.cache.EhCacheProvider
    instantiating and configuring caches
    building session factory
    Not binding factory to JNDI, no JNDI name configured
    SQL Error: 0, SQLState: 08001
    Server configuration denies access to data source
    Cannot open connection
    java.sql.SQLException: Server configuration denies access to data source
         at org.gjt.mm.mysql.MysqlIO.init(MysqlIO.java:144)
         at org.gjt.mm.mysql.Connection.<init>(Connection.java:230)
         at org.gjt.mm.mysql.Driver.connect(Driver.java:126)
         at java.sql.DriverManager.getConnection(DriverManager.java:525)
         at java.sql.DriverManager.getConnection(DriverManager.java:140)
         at net.sf.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:101)
         at net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:286)
         at net.sf.hibernate.impl.SessionImpl.connect(SessionImpl.java:3326)
         at net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:3286)
         at net.sf.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:40)
         at net.sf.hibernate.transaction.JDBCTransactionFactory.beginTransaction(JDBCTransactionFactory.java:19)
         at net.sf.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:2231)
         at com.mec.TestEmployee.createEmployee(TestEmployee.java:38)
         at com.mec.TestEmployee.main(TestEmployee.java:24)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
    Process finished with exit code 0

  • Question about Java vm interprocess communication.

    I was doing an interprocess communication test for fun recently and bump into a questions. My intention is to start two separate Java virtual machines in two separate processes and have them do some simple interaction. This should be done without socket programming. I can do it with sockets but is this test I just want to test how can and if it is possible to do IO between java vm without sockets (or RMI, or MPI or whatever). Just process IOstreams.
    While most documentation says that Java ProcessBuilder is meant to start an external process, I want to start a java vm process and do some IO with another java vm. Most examples demonstrate how to start a command shell or an external non-java program from Java, and say how to avoid the pitfall of IO streams and do it in separate threads. I can do that with Microsoft vbscript and have it talk to Java vm. That is easy. I have created an easy one to start Microsoft Voice to read something while Java is busy with number crunching.
    So I thought it should be easy for multiple Java virtual machines, too. It turns out, I am wrong. I post the test codes below. The Java experts in the forum, please review and give your expert thoughts. The code is ugly, I have to say.
    import java.io.*;
    import java.util.concurrent.*;
    class write_q implements Runnable {
    private LinkedBlockingQueue<String> out_q=null;
    private Process vm=null;
    public write_q(Process p){
    out_q=new LinkedBlockingQueue<String>(64);
    vm=p;
    public void write(String m){
    try {
    if (m !=null) out_q.put(m);
    catch(InterruptedException e){}
    return;
    public void run(){
    OutputStream o=vm.getOutputStream();
    try {
         String vv=out_q.take();
         //System.out.println(vv);
         byte[] b=vv.getBytes();
         o.write(b);
         o.flush();
         //System.out.println(vv);
         Thread.sleep(100);
    catch(IOException e1){
         System.out.println(e1.getMessage());
    catch(InterruptedException e2){
         System.out.println(e2.getMessage());
    return;
    class read_q implements Runnable {
    private LinkedBlockingQueue<String> in_q=null;
    private Process vm=null;
    public read_q(Process p){
    vm=p;
    in_q=new LinkedBlockingQueue<String>(64);
    public String read(){
    String v=null;
    try {
         v=in_q.take();
    catch(InterruptedException e){}
    return v;
    public void run(){
    byte[] b=new byte[256];
    InputStream ins=vm.getInputStream();
    try {
    while(true){
         int s=ins.read(b);
         if (s>0){
              String t=new String(b, 0, s).trim();
              in_q.put(t);
         //System.out.println("Read: "+t);
              if(t.equals("<>")) break;
         Thread.sleep(100);
    catch(IOException e){}
    catch(InterruptedException e3){}
    // end of class read_q
    public class morep{
    private static ExecutorService es=null;
    public morep(){
    es=Executors.newFixedThreadPool(2);
    public String read(){
    String v=null;
    return v;
    public void write(String msg){
    String v=this.read();
    return;
    public static void main(String[] args){
    ProcessBuilder pb=new ProcessBuilder("java", args[0]);
    pb.redirectErrorStream(true);
    pb.directory(new File(".//"));
    Process vm=null;
    morep mp=null;
    read_q reader=null;
    write_q writer=null;
    try {
         vm=pb.start();
         mp=new morep();
         writer=new write_q(vm);
         reader=new read_q(vm);
         es.execute(reader);
         es.execute(writer);
         System.out.println(reader.read());
         writer.write("Hello");
         System.out.println("Read: "+reader.read());
         writer.write("<>");
         System.out.println(reader.read());
         vm.waitFor();
         es.shutdown();
    catch(IOException e1){
         System.out.println(e1.getMessage());
    catch(InterruptedException e2){
         System.out.println(e2.getMessage());
    System.out.print("Press any key....");
    try {
         while(System.in.read()==-1);
    catch(IOException e3){}
    // end of main(String[] args)
    // end of class morep
    // this is the one started by morep.java
    import java.io.*;
    class talker {
    public static void main(String[] args){
    System.out.println("Ok, let\'s talk.");
    System.out.println("Since I am very talkative, be aware of the nuances.");
    System.out.println("Since I am not a bad guy, be aware of the nonscense.");
    BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    try {
    while(true){
         String x=br.readLine();
         if (x!=null) {
              System.out.println("+++ "+x);
              if (x.equals("<>")) break;
    catch(IOException e1){
         System.out.println("+++ "+e1.getMessage());
    // end of main(String[] args)
    // end of class talker
    Compiling the files will generate morep.class, talker.class, write_q.class and read_q.class. Then the talker.class will be started by morep.class, and managed by read_q.class and write_q.class.
    Run from the command line in Windows, the program hangs after initial messages. In Task Manager, two VMs are started by the program dead locked. I was expecting both VMs close down upon receiving "<>".
    C:\myjava\loader>java morep talker
    Ok, let's talk.
    Since I am very talkative, be aware of the nuances.
    Since I am not a bad guy, be aware of the nonscense.
    Hello
    Edited by: EJP on 13/04/2011 10:44: added code tags. Please use them.

    import java.io.*;
    import java.util.concurrent.*;
    class write_q implements Runnable {
    private LinkedBlockingQueue<String> out_q=null;
    private Process vm=null;
    public write_q(Process p){
    out_q=new LinkedBlockingQueue<String>(64);
    vm=p;
    public void write(String m){
    try {
    if (m !=null) out_q.put(m);
    catch(InterruptedException e){}
    return;
    public void run(){
    OutputStream o=vm.getOutputStream();
    try {
         String vv=out_q.take();
         //System.out.println(vv);
         byte[] b=vv.getBytes();
         o.write(b);
         o.flush();
         System.out.println(vv);
         Thread.sleep(100);
    catch(IOException e1){
         System.out.println(e1.getMessage());
    catch(InterruptedException e2){
         System.out.println(e2.getMessage());
    return;
    class read_q implements Runnable {
    private LinkedBlockingQueue<String> in_q=null;
    private Process vm=null;
    public read_q(Process p){
    vm=p;
    in_q=new LinkedBlockingQueue<String>(64);
    public String read(){
    String v=null;
    try {
         v=in_q.take();
    catch(InterruptedException e){}
    return v;
    public void run(){
    byte[] b=new byte[256];
    InputStream ins=vm.getInputStream();
    try {
    while(true){
         int s=ins.read(b);
         if (s>0){
              String t=new String(b, 0, s).trim();
              in_q.put(t);
         //System.out.println("Read: "+t);
              if(t.equals("<>")) break;
         Thread.sleep(100);
    catch(IOException e){}
    catch(InterruptedException e3){}
    // end of class read_q
    public class morep{
    private static ExecutorService es=null;
    public morep(){
    es=Executors.newFixedThreadPool(2);
    public String read(){
    String v=null;
    return v;
    public void write(String msg){
    String v=this.read();
    return;
    public static void main(String[] args){
    ProcessBuilder pb=new ProcessBuilder("java", args[0]);
    pb.redirectErrorStream(true);
    pb.directory(new File(".//"));
    Process vm=null;
    morep mp=null;
    read_q reader=null;
    write_q writer=null;
    try {
         vm=pb.start();
         mp=new morep();
         writer=new write_q(vm);
         reader=new read_q(vm);
         es.execute(reader);
         es.execute(writer);
         System.out.println(reader.read());
         writer.write("Hello");
         System.out.println("Read: "+reader.read());
         writer.write("<>");
         System.out.println(reader.read());
         vm.waitFor();
         es.shutdown();
    catch(IOException e1){
         System.out.println(e1.getMessage());
    catch(InterruptedException e2){
         System.out.println(e2.getMessage());
    System.out.print("Press any key....");
    try {
         while(System.in.read()==-1);
    catch(IOException e3){}
    // end of main(String[] args)
    // end of class morep
    }

  • BI setup: WebAS ABAP Setting - Java to ABAP communication problem

    Hello,
    i've got a problem during intallation of BI in Netweaver 2004s. The Diagnostics & Support Desktop Tool reports errors in WebAS ABAP Settings. These errors are:
    - "Web Template Validation failed due Java to ABAP communication problem (return code:ERSBOLAP018)"  with the suggested solution "Check Connector Connection of System Object in Portal System Landscape". What does it mean?
    - "Call ABAP->Java for function RSWR_RFC_SERVICE_TEST failed for destination <destination>" and "Call ABAP->Java for function RSRD_MAP_TO_PORTAL_USERS failed for destination <destination>" with suggested solution "Check the data of the destination in transaction SM59. Check that the target host is running and has registered a program id in the gateway." Run of transaction SM59 returns no errors.
    Further i've take a look in the log 'dev_jrfc.trc' and there i found the errors:
    - Exception thrown by application running in JCo Server
    java.lang.RuntimeException: Bean RSRD_MAP_TO_PORTAL_USERS not found on host <host>
    - Exception thrown by application running in JCo Server
    java.lang.RuntimeException: Bean RSWR_RFC_SERVICE_TEST not found on host  <host>
    - Exception thrown by application running in JCo Server
    java.lang.RuntimeException: Bean RSWR_PREEXECUTION_PROXY not found on host  <host>
    Can these errors be the cause of the WebAS ABAP Setting error displayed in the Diagnostics & Support Desktop Tool? How they can be solved?
    Thanks for your help,
    Martin

    Hello Chetan,
    thanks for your response. Maybe i've described my problem not clear enough. There is no problem of installation and usage of support & dektop tool, but of installation of BI. The support & dektop tool indicates the errors described above with no other hints. My questions is, if anybody knows, what is the cause of the errors and what i must do, to install BI correctly.
    Cheers,
    Martin

  • Java.lang.process.execute()

    Java.lang.process.execute() is throwing an exception with string �Cannot allocate memory� ...
    what is the cause of this exception and give me the solution
    plz help
    Nilesh

    882590 wrote:
    Is it possible to use the java.lang.ProcessBuilder to execute a Java process pointing it to jvm.dll instead of java.exe? I'm using the JavaFX self contained application packaging and it creates a runtime/jre/bin directory that contains jvm.dll, but not java.exe.I don't get the line of questioning of this thread. If you're using the JavaFX stuff the answer must lie in the JavaFX documentation. It seems to indicate that it generates an executable of its own which will likely wrap the jvm DLL, so you should be invoking the generated executable in ProcessBuilder.
    http://docs.oracle.com/javafx/2/deployment/self-contained-packaging.htm

  • Java Business Process Monitoring

    Hello Experts,
    I want to setup Business Process Monitoring between Solman and ECC system.
    Is it possible to setup the JAVA Based  Business process monitoring ?.
    If its possile how to setup for JAVA Busness process monitoring.
    Thanks
    Nikkil

    Hello Nikkil,
    there is no content currently shipped in order to perform Business Process Monitoring for Java components. Can you specify what kind of application you are looking at and what it would be that you owuld like to monitor as part of a business process?
    We could then evaluate in what way a corresponding enhancement for Business Process Monitoring could be also useful for other customers.
    Best Regards
    Volker

  • Java.lang.Process.exec()

    I have read a article about the "java.lang.Process.exec()" (url:http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html)
    Having some questions with the example in it.
    The example code:
    import java.util.*;
    import java.io.*;
    public class BadExecJavac
        public static void main(String args[])
            try
                Runtime rt = Runtime.getRuntime();
                Process proc = rt.exec("javac");
                //int exitVal = proc.exitValue();
                int exitVal = proc.waitFor();
                System.out.println("Process exitValue: " + exitVal);
            } catch (Throwable t)
                t.printStackTrace();
    }The process can run but never complete.
    Why? Just because when invoke the javac.exe without any argument,it will product a set of usage statements that describe how to run the program and the meaning of all the available program options.So the process is in deadlock.
    The question is, when i change the exec("javac") to exec("javac a.java"), in which the "a.java" is not exist, so the jvm should product error:
    error: cannot read: a.java
    1 error
    But after i changed the code and run the class, at this time the process can run and complete.
    The two codes both product some statements,but why the first one never complete,but the second did. Why?

    import java.util.*;
    import java.io.*;
    public class A
        public static void main(String args[])
            try
                Runtime rt = Runtime.getRuntime();
                Process proc = rt.exec("javac");
                InputStream is = proc.getErrorStream();
                int i=0;
                while ((i = is.read()) != -1)
                    System.out.print((char)i);
                // int exitVal = proc.exitValue();
                // int exitVal = proc.waitFor();
                // System.out.println("Process exitValue: " + exitVal);
            } catch (Throwable t)
                t.printStackTrace();
    }usng this modification, i could see some error messages.
    because exec(cmd) executes the command in a separate process, it will not display the results on the current console. If you want see the results, you should use getInputStream() and getErrorStream().
    good luch ^^

  • Java.lang.Process input stream waiting until process is complete to print

    I have tried to simplify this problem as much as possible. Basically, I have a java.lang.Process which executes a simple C program.
    test.c
    #include <stdio.h>
    #include <unistd.h>
    int main()
      printf("foo\n");
      sleep(2);
      printf("bar\n");
    ...The process has an input stream and error stream handler each on a separate thread. I have tried both buffered and unbuffered (BufferedReader, BufferedInputStream, InputStreamReader...) stream handlers. Both produce the same problem of waiting until the process has exited to receive anything from the process's streams.
    The only time this does not happen is when I call fflush(stdout); after each printf(). This can't be a solution because the real application calls a massive C application which would require thousands of fflush()'s to be added. What is causing this to happen? This doesn't happen when the C program is executed from the shell. Is there a way the InputStream can be forced to extract from the stream?

    hi.....
    I have closed the output stream of the process as you told me to do...
    The hitch is that, if my program contains only printf() statements,it works fine
    as soon as scanf() statement is encountered within the C code,it is totally neglected,and the output comes as if no scanf() statement existed in the C code.
    Consequently the thread doesnt wait for input which was bound for scanf() from the thread
    the code...
        public void run()
         try
             PrintWriter out = new PrintWriter(socket.getOutputStream(),true);
             BufferedReader in = new BufferedReader(
                            new InputStreamReader(
                            socket.getInputStream()));
             try
                     Process p;
              p=new ProcessBuilder("./a.out").start();
                     PrintWriter exOut=null;
                     BufferedReader exIn=null;
              exOut = new PrintWriter(p.getOutputStream(),true);
              exIn = new BufferedReader(
                           new InputStreamReader(
                           p.getInputStream()));
                  //String inputLine="", outputLine="";        
                  String str="";
                     int c;          
                  while(true)                   
                        //System.out.println("In While");
                  str="";exOut.close();                  
                        while((c=exIn.read())!=-1)
                                 str=str+(char)(c);
                                    System.out.print(str);
                        str=str+(char)(0);
                        System.out.print(str+"outside");
                        out.print(str);
                        sleep(100);
                        try
                            int x=p.exitValue();
                              out.print(str);
                   System.out.print("Bye 1");
                            String str1="Bye"+(char)(0);
                   out.println(str1);              
                   break;
                        catch(IllegalThreadStateException e)
                            //System.out.println("The Process has not ended yet");
                        //str=str+((char)-1);
                        //System.out.print(str+"Control reaches here too");
                        str="";
                        exOut = new PrintWriter(p.getOutputStream(),true);//I have tried to run the program without this also but the effect is the same
                        while((c=in.read())!=-1)
                            str=str+(char)(c);                                    
                        if(str.contentEquals(""))
                                System.out.print("Bye 2");
                                String str1="Bye"+(char)(0);
                                out.println(str1); 
                                p.destroy();
                                exOut.close();
                                exIn.close();
                                out.close();
                                in.close();        
                                socket.close();
                                break;
                        //str=str+(char)(0);
                  exOut.print(str);
                        try
                            int x=p.exitValue();
                            System.out.print("Bye 3");
                            String str1="Bye"+(char)(0);
                   out.println(str1);
                            break;
                        catch(IllegalThreadStateException e)
                            //System.out.println("The Process has not ended yet");
                  /*while ((inputLine = in.readLine()) != null)
                        exOut.println(inputLine);
                        outputLine=exIn.readLine();
                        //outputLine=inputLine;
                        //out.println(outputLine);}*/                   
             exOut.close();
             exIn.close();
             catch(IOException e)
                  System.err.println("Accept failed."+e);
             out.close();
             in.close();        
             socket.close();
         catch (Exception e)
             e.printStackTrace();
    }

  • Java.sql.SQLException: Communication failure during handshake.

    I'm troubled by this problem followed:
    the exception is decripted as:
    java.sql.SQLException: Communication failure during handshake. Message from server: "Unknown database 'cust'"
    I'm using JSP to access the MYSQL database. the database server has three databases:mysql,test,customer. my OS is win98. I can access the customer using "mysql -u root -p customer" in the command prompt.
    but when I runs the JSP, the error appears.
    the connection string is :
    private String protocol = "jdbc:mysql://localhost/customer?user=customer_f&password=151276&useUnicode=true&characterEncoding=8859_1";
    if the connection string is :
    private String protocol = "jdbc:mysql://localhost/test?user=customer_f&password=151276&useUnicode=true&characterEncoding=8859_1";
    or
    private String protocol = "jdbc:mysql://localhost/mysql?user=customer_f&password=151276&useUnicode=true&characterEncoding=8859_1";
    there's no problem.
    what is wrong ?
    I guess it's wrong with mysql's setting.
    please help me,lots of thks.

    It seems user root is the owner of 'customer' database. Can you use root to access 'customer' from JSP code?
    Another hint:
    Do you grant user customer_f privileges to 'customer' database when create 'customer'?
    with root access from mysql> prompt:
    mysql>grant all privileges on customer.* to customer_f@"localhost" identified by '151276';
    Then, user customer_f will have all privileges to access 'customer' either from prompt or JSP page.
    about Creating Users and Setting permission in MySQL
    see http://www.devarticles.com/content.php?articleId=134

  • Java Compilation Process and how it relates to portability

    I need to know more about the java compilation process, how it achieves porability and its drawback and benifits. Can anyone help me with a link or an answer?
    Help would be much appriciated!

    javac, the Java compiler, is written in Java itself. It generates .class
    files from your .java source files. Those .class files are loaded by the
    JVM (the Java Virtual Machine) and executed. The javac compiler
    itself consists of just a bunch of those .class files and the compiler
    doesn't even know on what platform it is running while compiling
    your .java files.
    If you simply carry over the tools.jar file (and some other .jars) in which
    the package com.sun.tools.javac resides to another platform where a
    JVM is installed you can compile your .java files on that other platform
    too. And those compiled classes will run on that platform too ;-)
    kind regards,
    Jos

  • Problem with starting a sqlplus-process via java.lang.Process

    Hi,
    I want to start a sqlplus-Process from a java-application via java.lang.Process. Works great with XP. On a W2K-Machine, the process is started (I can see it in the Taskmanager), but it doesn't connect to the db - the OS-process hangs, also the java-application which invoked the process.
    If I start a sqlplusw.exe-Process instead of sqlplus.exe, it works as well.
    Does anybody know what's going wrong ?
    I'm using java 1.5.0_11 and Oracle Database 10g Enterprise Edition Release 10.2.0.3.0
    Thanks in advance
    Jens

    java.lang.Process can be used to perform an OS Shell to launch specific tasks. But why are you interested in specifically launching sqlplus from here?
    ~ Madrid
    http://hrivera99.blogspot.com/

  • PROBLEM:IOException starting Java runtime process

    Hi all,
    I am new to java and I have the following problem: I have created an applictaion using jbuilder (windows xp) that consists of various frames.
    The application was compling and running at the PC I used to create it . Now, I am using a new PC with 2 processors (intel Pentium (D) 3.6) and I get the following error when trying to run the already developed application. Also, I tried to build a new application and I still get the same error.
    I would be very greatful for your comments/suggestions..
    Thanks in advance
    artakianos
    -- IOException starting Java runtime process --
    java.io.IOException: CreateProcess: "C:\Program Files\Borland\Jbuilder\jdk1.4\bin\javaw" -classpath "C:\Documents and Settings\sstathak\jbproject\MCTOOLS\classes\mctools;C:\Borland\JBuilder2005\lib\jbcl.jar;C:\Borland\JBuilder2005\lib\dx.jar;C:\Borland\JBuilder2005\lib\beandt.jar;C:\Program Files\Borland\Jbuilder\jdk1.4\jre\javaws\javaws.jar;C:\Program Files\Borland\Jbuilder\jdk1.4\jre\lib\charsets.jar;C:\Program Files\Borland\Jbuilder\jdk1.4\jre\lib\ext\dnsns.jar;C:\Program Files\Borland\Jbuilder\jdk1.4\jre\lib\ext\ldapsec.jar;C:\Program Files\Borland\Jbuilder\jdk1.4\jre\lib\ext\localedata.jar;C:\Program Files\Borland\Jbuilder\jdk1.4\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Borland\Jbuilder\jdk1.4\jre\lib\im\indicim.jar;C:\Program Files\Borland\Jbuilder\jdk1.4\jre\lib\im\thaiim.jar;C:\Program Files\Borland\Jbuilder\jdk1.4\jre\lib\jce.jar;C:\Program Files\Borland\Jbuilder\jdk1.4\jre\lib\jsse.jar;C:\Program Files\Borland\Jbuilder\jdk1.4\jre\lib\plugin.jar;C:\Program Files\Borland\Jbuilder\jdk1.4\jre\lib\rt.jar;C:\Program F&#148;

    Maybe your classpath is wrong. You can go to the path where is the instalation and into the directory bin you must `type javac or javaws if you obtain a list of options every is ok and you must set the enviroment variable to this path.
    Send me your comments
    Miguel Manzano

  • Java.exe process

    I've been searching high and low to figure out how to set a java.exe process to high all the time. Its for a server that i run and im learing java in school just havent gotten to that class yet. Its a batch file but when i set it to start/high it doest alow the server to restart, just shuts it down. with out the comand its fine, but id have to go to task manager to set the priority to high. Is there a way to make it High all the time??? thanks.

    Grimm0ne wrote:
    I've been searching high and low to figure out how to set a java.exe process to high all the time. You mean thread priority?
    Its for a server that i run and im learing java in school just havent gotten to that class yet. Its a batch file but when i set it to start/high it doest alow the server to restart, just shuts it down. with out the comand its fine, but id have to go to task manager to set the priority to high. Is there a way to make it High all the time??? thanks.I don't know of any such thing.
    %

  • Two java.exe processes running in the Task Manager in Windows XP

    I tried to find the best possible place to post this and after spending about 20 minutes searching for an appropriate forum starting from java.com I ended up here. So forgive me if the is a wrong place and if there?s a more appropriate place for my question, please provide a pointer to it.
    I don't know much about java and what it does but as the title says when I open the Task manager there are two java.exe processes running at the same time with about 20 000 k each.
    One of the processes is coming from:
    C:\Program Files\Alias\Maya6.5\docs\jre\bin\java.exe
    and the other from:
    C:\Program Files\Alias\Maya7.0\docs\jre\bin\java.exe
    in addition to that a jusched.exe process is also running coming from
    C:\Program Files\Java\jre1.5.0_10\bin\jusched.exe
    I rarely open the Maya 6.5 and 7 documentations but the two java.exe process are running all the time and I would like to stop them running when I don?t need them but I don?t know how.
    I can't end these processes from the Task Manager; they reappear immediately after I end them.
    Any help with this is greatly appreciated.
    Thank you

    Try to see:
    http://forums.cgsociety.org/showthread.php?t=294973
    Bye,
    leo

  • IOException starting Java runtime process

    Whenever i run a program, i get this error
    -- IOException starting Java runtime process --
    java.io.IOException: CreateProcess: D:\Borland\JBuilder2005\jdk1.4\bin\javaw -classpath "E:\Documents and Settings\Administrator\jbproject\SwingApplication\classes;D:\Borland\JBuilder2005\jdk1.4\jre\lib\im\indicim.jar;D:\Borland\JBuilder2005\jdk1.4\jre\lib\im\thaiim.jar;D:\Borland\JBuilder2005\jdk1.4\jre\lib\ext\dnsns.jar;D:\Borland\JBuilder2005\jdk1.4\jre\lib\ext\sunjce_provider.jar;D:\Borland\JBuilder2005\jdk1.4\jre\lib\ext\ldapsec.jar;D:\Borland\JBuilder2005\jdk1.4\jre\lib\ext\localedata.jar;D:\Borland\JBuilder2005\jdk1.4\jre\lib\jsse.jar;D:\Borland\JBuilder2005\jdk1.4\jre\lib\plugin.jar;D:\Borland\JBuilder2005\jdk1.4\jre\lib\sunrsasign.jar;D:\Borland\JBuilder2005\jdk1.4\jre\lib\charsets.jar;D:\Borland\JBuilder2005\jdk1.4\jre\lib\rt.jar;D:\Borland\JBuilder2005\jdk1.4\jre\lib\jce.jar;D:\Borland\JBuilder2005\jdk1.4\jre\javaws\javaws.jar;D:\Borland\JBuilder2005\jdk1.4\lib\tools.jar;D:\Borland\JBuilder2005\jdk1.4\lib\dt.jar;D:\Borland\JBuilder2005\jdk1.4\lib\htmlconverter.jar" swingapplication.SwingApplication error=3
    I use JBuilder , if this error is related to classpath, how do i set path? please help me

    Can javaw.exe be found at that location?
    - Saish

Maybe you are looking for