Problem in running a program in java mysql

i have a lot of nested java programs, individual testting results are ok, how ever, the following results occur when i combine those codes, do you have any idea about this? sorry about this but i hope you can help me.... thanks in advance....
false
true
java.sql.SQLException: Illegal operation on empty result set.
at com.mysql.jdbc.ResultSet.checkRowPos(ResultSet.java:680)
at com.mysql.jdbc.ResultSet.getStringInternal(ResultSet.java:5021)
at com.mysql.jdbc.ResultSet.getString(ResultSet.java:4999)
at checkvalidity.tesdiscode(checkvalidity.java:44)
at forplay.play(forplay.java:7)
at test1.main(test1.java:27)
false
java.sql.SQLException: Illegal operation on empty result set.
at com.mysql.jdbc.ResultSet.checkRowPos(ResultSet.java:680)
at com.mysql.jdbc.ResultSet.getStringInternal(ResultSet.java:5021)
at com.mysql.jdbc.ResultSet.getString(ResultSet.java:4999)
at checkvalidity.tesdiscode(checkvalidity.java:44)
at forplay.play(forplay.java:19)
at test1.main(test1.java:27)
java.sql.SQLException: Illegal operation on empty result set.
at com.mysql.jdbc.ResultSet.checkRowPos(ResultSet.java:680)
at com.mysql.jdbc.ResultSet.getStringInternal(ResultSet.java:5021)
at com.mysql.jdbc.ResultSet.getString(ResultSet.java:4999)
at checkvalidity.tesdiscode(checkvalidity.java:44)
at forplay.play(forplay.java:31)
at test1.main(test1.java:27)
java.sql.SQLException: Illegal operation on empty result set.
at com.mysql.jdbc.ResultSet.checkRowPos(ResultSet.java:680)
at com.mysql.jdbc.ResultSet.getStringInternal(ResultSet.java:5021)
at com.mysql.jdbc.ResultSet.getString(ResultSet.java:4999)
at checkvalidity.tesdiscode(checkvalidity.java:44)
at forplay.play(forplay.java:34)
at test1.main(test1.java:27)
Sorry, you have submitted an invalid promo code. Please try again. To send more
entries text SMB PLAY <Promocode> to 2622. Ex. SMB Play abcd123. To start playin
g games log-on to www.smbplay.com/activ8 Create ur group, play & win as a team,
text SMB GROUP to 2622. To learn mre abt this promo text SMB HELP. Mre points, m
re games, mre chances of winning! Promo pd is fr Jul 1�06 � Jul 1 �07. BFAD#dean
silver. P2.50/txt
C:\jwork\smbcode>javac test1.java
test1.java:24: ')' expected
System.out.println(checkvalidity.tesdiscel("639155510003");
^
1 error

about this code:
C:\jwork\smbcode>javac test1.java
test1.java:24: ')' expected
System.out.println(checkvalidity.tesdiscel("639155510003");
^
1 error
i solved this one, the upper is the problem, i made a class for handling mysql - inputting and retrieving datas, the other classes are handling conditional outputs and the actual outputs. the later part of the output is, however, correct, the text that i prepared for the condition class... but still, the problem is that there are a lot of sql exceptions that i don't understand, i do appreciate if you help me more, thank you, by the way, how can i give out duke dollars for the guys who helped me?

Similar Messages

  • How to run native program with Java program?

    Hello
    I've got following problem. I'd like to write file browser which would work for Linux and
    Windows. Most of this program would be independent of the system but running programs not. How to run Linux program from Java program (or applet) and how to do it in Windows?.
    Cheers

    Try this:
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec("ls -l");
    InputStream stream = proc.getInputStream();
    InputStreamReader isr = new InputStreamReader(stream);
    BufferedReader br = new BufferedReader(isr);
    String line = null;
    while ( (line = br.readLine()) != null) .....
    "if the program you launch produces output or expects input, ensure that you process the input and output streams" (http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html)

  • Problems running external programs from java

    Hello.
    I wrote a pair of perl scripts and a GUI in java to run them. The first perl script just read the files in one directory makes some changes to the names of the files and then group all this files in a set of new directories. The other perl scripts takes all this new files and calls BLAST sequence alignment program and perform some alignments among these sequences. I tested this scripts and they work fine.
    The problem comes when I try to run them for the JAVA GUI. I use RunTime and when I need to run the first perl script it all works well, but when The call to the second perl script is made the program fisishes without doing anything at all. I found out that the problem is that when running the script from the Java GUI it's not able to find BLAST program. So I guess that Java is not really starting a terminal session and it doesn't read my bash_profile to find out the path to my programs.
    So, my question is if anyone knows a method to tell Java to load all this paths in the bash_proflie file so all of my scripts work???.
    I have no idea is this can be done and how so any advice would be really wellcome.
    By the way, my java version is 1.4.2 and my OS is Mac OS X 10.3
    Thanks a lot , Julio

    Invoke /bin/sh -c and give it your program's full path with.
    (To understand what I've written, maybe reading
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps_p.html
    http://mindprod.com/jgloss/exec.html
    and
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html
    (especially the exec(String[] cmdarray) method)
    might help)
    -T-

  • Problem while running client program in Netbeans4.0

    Hi,
    I am facing the following problem while running a client program in Nebeans4.0.
    An unexpected exception has been detected in native code outside the VM.
    Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C9012B4
    Function=RtlInitAnsiString+0x1B
    Library=C:\WINDOWS\system32\ntdll.dll
    Current Java thread:
    at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
    at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:770)
    at java.net.InetAddress.getAddressFromNameService(InetAddress.java:1059)
    at java.net.InetAddress.getAllByName0(InetAddress.java:1009)
    at java.net.InetAddress.getAllByName0(InetAddress.java:981)
    at java.net.InetAddress.getAllByName(InetAddress.java:975)
    at weblogic.rjvm.RJVMFinder.getDnsEntries(RJVMFinder.java:370)
    at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:181)
    - locked <0x1007ff78> (a weblogic.rjvm.RJVMFinder)
    at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:125)
    at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:291)
    at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:234)
    at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:135)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
    at javax.naming.InitialContext.init(InitialContext.java:219)
    at javax.naming.InitialContext.<init>(InitialContext.java:195)
    at AcfClient.getHomeRef(AcfClient.java:73)
    at AcfClient.forceSession(AcfClient.java:43)
    at AcfClient.main(AcfClient.java:34)
    Dynamic libraries:
    0x00400000 - 0x00406000      C:\Data\j2sdk1.4.2_04\jre\bin\java.exe
    0x7C900000 - 0x7C9B0000      C:\WINDOWS\system32\ntdll.dll
    0x7C800000 - 0x7C8F4000      C:\WINDOWS\system32\kernel32.dll
    0x77DD0000 - 0x77E6B000      C:\WINDOWS\system32\ADVAPI32.dll
    0x77E70000 - 0x77F01000      C:\WINDOWS\system32\RPCRT4.dll
    0x77C10000 - 0x77C68000      C:\WINDOWS\system32\MSVCRT.dll
    0x08000000 - 0x08138000      C:\Data\j2sdk1.4.2_04\jre\bin\client\jvm.dll
    0x77D40000 - 0x77DD0000      C:\WINDOWS\system32\USER32.dll
    0x77F10000 - 0x77F56000      C:\WINDOWS\system32\GDI32.dll
    0x76B40000 - 0x76B6D000      C:\WINDOWS\system32\WINMM.dll
    0x6BD00000 - 0x6BD0D000      C:\WINDOWS\system32\SYNCOR11.DLL
    0x10000000 - 0x10007000      C:\Data\j2sdk1.4.2_04\jre\bin\hpi.dll
    0x00390000 - 0x0039E000      C:\Data\j2sdk1.4.2_04\jre\bin\verify.dll
    0x003B0000 - 0x003C9000      C:\Data\j2sdk1.4.2_04\jre\bin\java.dll
    0x003D0000 - 0x003DD000      C:\Data\j2sdk1.4.2_04\jre\bin\zip.dll
    0x02DA0000 - 0x02DAF000      C:\Data\j2sdk1.4.2_04\jre\bin\net.dll
    0x71AB0000 - 0x71AC7000      C:\WINDOWS\system32\WS2_32.dll
    0x71AA0000 - 0x71AA8000      C:\WINDOWS\system32\WS2HELP.dll
    0x71A50000 - 0x71A8F000      C:\WINDOWS\System32\mswsock.dll
    0x76F20000 - 0x76F47000      C:\WINDOWS\system32\DNSAPI.dll
    0x76FB0000 - 0x76FB8000      C:\WINDOWS\System32\winrnr.dll
    0x76F60000 - 0x76F8C000      C:\WINDOWS\system32\WLDAP32.dll
    0x66210000 - 0x66219000      C:\WINDOWS\system32\netware\NWWS2NDS.DLL
    0x50D50000 - 0x50D95000      C:\WINDOWS\system32\NETWIN32.DLL
    0x50D00000 - 0x50D15000      C:\WINDOWS\system32\CLNWIN32.DLL
    0x50DF0000 - 0x50E10000      C:\WINDOWS\system32\LOCWIN32.DLL
    0x50DB0000 - 0x50DD9000      C:\WINDOWS\system32\NCPWIN32.dll
    0x71AD0000 - 0x71AD9000      C:\WINDOWS\system32\WSOCK32.dll
    0x66220000 - 0x6622C000      C:\WINDOWS\system32\netware\NWWS2SLP.DLL
    0x1C000000 - 0x1C007000      C:\WINDOWS\system32\NWSRVLOC.dll
    0x76C90000 - 0x76CB8000      C:\WINDOWS\system32\imagehlp.dll
    0x59A60000 - 0x59B01000      C:\WINDOWS\system32\DBGHELP.dll
    0x77C00000 - 0x77C08000      C:\WINDOWS\system32\VERSION.dll
    0x76BF0000 - 0x76BFB000      C:\WINDOWS\system32\PSAPI.DLL
    Heap at VM Abort:
    Heap
    def new generation total 576K, used 497K [0x10010000, 0x100b0000, 0x104f0000)
    eden space 512K, 89% used [0x10010000, 0x10083158, 0x10090000)
    from space 64K, 57% used [0x100a0000, 0x100a9478, 0x100b0000)
    to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000)
    tenured generation total 1408K, used 129K [0x104f0000, 0x10650000, 0x14010000)
    the space 1408K, 9% used [0x104f0000, 0x10510438, 0x10510600, 0x10650000)
    compacting perm gen total 4096K, used 2122K [0x14010000, 0x14410000, 0x18010000)
    the space 4096K, 51% used [0x14010000, 0x14222828, 0x14222a00, 0x14410000)
    Local Time = Fri Aug 26 10:26:03 2005
    Elapsed Time = 2
    # The exception above was detected in native code outside the VM
    # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode)
    # An error report file has been saved as hs_err_pid1280.log.
    # Please refer to the file for further information.
    Can anyone pls let me know what could be the problem.
    Thanks in adv.

    Hi,
    This type of error
    java.lang.NoClassDefFoundError: javax/naming/Context
    will occur when the client program could not able to locate lib/j2EE.jar file.
    So set the classpath correctly and make sure that you have correctly defined the JAVA_HOME environment variable in .bat script.
    Hope this will help you.
    Regards,
    Anil.
    Technical Support Engineer.

  • Problems in running SQLJ programs!

    Dear SQLJ Support,
    I am not able to run SQLJ programs. I am able to compile a .sqlj file.
    I tried to compile the demo programs, for example, TestInstallCreateTable.java. I get
    "Class oracle.sqlj.runtime.Oracle not found in import" error.
    "Class sqlj.runtime.ref.DefaultContext not found in import" error.
    When I try to run the other Demo programs also, I am getting errors at places where I import classes from translator.zip. Is there a problem with the JDBC Drivers?
    I have set the classpath set to
    ORACLE_HOME/sqlj/lib/translator.zip, where the classes are found
    ORACLE_HOME/jdbc/lib/classes111.zip, where the JDBC classes are found
    JAVA_HOME/lib/classes.zip, where the core java classes are found
    I am using Oracle 8.1.6, SQLJ 8.1.6, JDK 1.1.8 on Windows NT 4.0.
    Am I missing something else? Kindly advice. Thanks in advance.
    Regards,
    Radha.

    You might wanna try changing the Look and Feel of the swing application. Test it on default, Windows, Mac and Motif interface.... and do post if it works on changing the look and feel.
    cheerz

  • Problem with running a program under Labview 8.6

    Hello,
    I am writing you this to ask for your technical support to fix the problem I am facing at our Lab at University of California, Irvine.
    Ms. Vanessa Trujillo has kindly come to our lab a couple of times and tried different things to resolve the issue, but unfortunately the issue is not resolved yet. Here is a summary of the problem:
    We used to use Labview 6.1 for our fatigue testing and data acquisition.
    Our
    program worked just fine under the 6.1 version We recently upgraded our software to Labview 8.6. We have also purchased a new computer that has higher capacity than what your website requires for Labview 8.6. The new computer has Windows Vista We transferred our old program/subprograms from the old computer under Labview
    6.1 to the new computer with labview 8.6. However our program that worked fine with the 6.1 version is not working with the updated version (ver 8.6).
    There
    are 6 errors in the error list. It appears there are six files of my program missing under the new version, even though we transferred all files.
    The software searches for those files but can't find them.
            For example one the box pops up indicates:
            loading:
                        <vlib>:\Daq\lvdaq.dll
            searching:
                        C:\Program Files\National Instrument\LabVIEW 8.6\instr.lib\Agilent34401\public\utility
            I get several message like this. I have to cancel/ignore them all to be able to open the program.
    When we go to VI's under Measurement I/O there is nothing (empty).
    We use a PCI-MIO-16XE-50 for our data acquisition During Labview installation on the new computer, I was asked if I wanted to install the device drivers. I had two options, "Now" or "Later", I picked Now but I didn't have the DVD's/CD's for the device drivers. Therefore I had to select later to complete my software installation Later after Labview 8.6 installation, we installed the device drivers (traditional Ni DAQ and Ni DAQmx) from the two old CD's we had in our lab from a couple of years ago (the CD's were Ni DAQ 7). after installation, the PCI board on the computer was recognized by the device driver. However we still could not run our program under the new version of Labview (same situation and the same messages) I called 1-866-275-6964 on 9/2/08 and talked to Grant (service number:
    1228841). He recommended that I download and install the updated version of device drivers.
    Since I didn't have the DVD/CD for updated device drivers, I contacted Vanessa Trujillo. She gave me the DVD for the updated Ni DAQ (Traditional and mx).
    But
    when I tried to install the updated device drivers I got a message something like "some unsupported filed have been detected,..." so the updated device
    drivers were not installed. It should be noted that up to here we still had the Ni DAQ (traditional and mx) installed on the computer from our old CD's (Ni DAQ 7).
    Vanessa and I talked to Tom at the technical support department. He recommended that we download and install the Beta xx version for Ni DAQ since we were using Windows Vista. Mike put the Beta software on the Ni website/outgoing so I could download and install it. He asked me to uninstall the traditional Ni DAQ that we had on our computer from the older CD's. He
    asked me not to un-install the Ni DAQmx (that we had installed from the old
    CD). I was able to download the Beta software, however I could not install it since I got a similar message that some unsupported files were detected.
    Right now we don't have any version of traditional Ni DAQ installed on the
    computer but the NI DAQmx (from old Ni DAQ 7) is still installed on the computer. Vanessa let me borrow her new Ni DAQ DVD but as I explained I am not able to install the device drivers.
    Vanessa - Did I miss anything?
    Please advise. My cell number is 619-778-2033. I will be at our lab at UC,
    Irvine at 2:00pm (CA/Pacific time). Please call if you have any questions.
    Thank you

    To me, it looks like you are missing some of the drivers and subVI's used in your program.
    Whatever device you are using to measure fatigue or any other device probably came with a driver.
    You need all of these drivers installed on this new computer.
    Also, any subVI's and libraries you use in the program must also be installed on the new computer.
    Whenever you get a message that says you are missing some component (the ones that you said you press 'ignore'),
    see if you can find that library or subVI on the older computer. If so, save it to something so you can transfer them to the new computer. 
    Cory K

  • How to compile and run package programs in Java

    Hi,
    I want to know how to compile and run the package programs in Java using -d. instead of creating the package folder manually.
    eg:
    package Test;
    class test1
    public void disp()
    //Any code;
    I want to compile this without creating the folder ' Test ' manually. that is if we use -d with javac the Test folder will be created automatically. I need the format of -d
    could anyone please help me.
    Thanks in Advance ,
    Ambika

    My program Test.java in F:\Tomcat5\webapps\Ambika\WEB-INF\Classes. I compiled in the format below. I got like this. What should I do for this? But yesterday I compiled like this only, It compiled and the folder com\cert\Test.class is created. Today again I compiled the pgm after deleting the already created folder 'com\cert', I got the error like this.
    I've given my pgm and the thing I've got when I compiled it.
    Test.java
    package com.cert;
    public class Test
         public void display()
              System.out.println("Hai");
    F:\Tomcat5\webapps\Ambika\WEB-INF\Classes>javac -d F:\Tomcat5\webapps\Ambika\WEB-INF\Classes\Test.java
    javac: no source files
    Usage: javac <options> <source files>
    where possible options include:
    -g Generate all debugging info
    -g:none Generate no debugging info
    -g:{lines,vars,source} Generate only some debugging info
    -nowarn Generate no warnings
    -verbose Output messages about what the compiler is doing
    -deprecation Output source locations where deprecated APIs are u
    sed
    -classpath <path> Specify where to find user class files
    -cp <path> Specify where to find user class files
    -sourcepath <path> Specify where to find input source files
    -bootclasspath <path> Override location of bootstrap class files
    -extdirs <dirs> Override location of installed extensions
    -endorseddirs <dirs> Override location of endorsed standards path
    -d <directory> Specify where to place generated class files
    -encoding <encoding> Specify character encoding used by source files
    -source <release> Provide source compatibility with specified release
    -target <release> Generate class files for specific VM version
    -version Version information
    -help Print a synopsis of standard options
    -X Print a synopsis of nonstandard options
    -J<flag> Pass <flag> directly to the runtime system
    F:\Tomcat5\webapps\Ambika\WEB-INF\Classes>
    Plz help me.
    thanks in advance
    Ambika

  • Why i get error msg when i run my program? (java.lang.NoClassDefFoundError)

    i have compile and run my program. First time the program can run. But after that when i run, come out error messege as below:
    java.lang.NoClassDefFoundError: FormPoster (wrong name: search/FormPoster)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
    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)
    Exception in thread "main"
    what can i do? thank very much

    Hello,
    i have compile and run my program. First time theprogram can run.
    But after that when i run, come out error messegeas below:
    java.lang.NoClassDefFoundError: FormPoster (wrongname: search/FormPoster)
    Check your FormPoster class: the classname has to be
    the same as
    the file name and the class should be stored in its
    correct directory
    (the sub directory structure should reflect the
    package name).
    kind regards,
    JosYou should also check your clsspath if you are using packages.

  • Running perl programs through java.

    How do i run a perl program through java?
    arg.pl :
    while(<STDIN>)
    print;
    java program that I tried:
    import java.io.*;
    class runtime
        static Process p;
        static BufferedReader stdOutput;
        static BufferedWriter stdInput;
        public static void main(String args[]) throws IOException
            int i = 0;
            try{
                String cmd[] = new String[] {"perl","arg.pl"};
                p = Runtime.getRuntime().exec(cmd,null,new File("./"));
                stdOutput = new BufferedReader(new InputStreamReader(p.getInputStream()));
                stdInput = new BufferedWriter(new OutputStreamWriter(p.getOutputStream()));
            catch(Exception ex){
                System.out.println("Unable to initiate Process : " + ex);
            stdInput.write("abcd\n");
            stdInput.write("1234\n");
            stdInput.write("efgh\n");
            stdInput.write("5678\n");
            stdInput.close();
            System.out.println(stdOutput.readLine());
            System.out.println(stdOutput.readLine());
            System.out.println(stdOutput.readLine());
            System.out.println(stdOutput.readLine());
    }This works well. But I need to read the output line by line as and when i give the standard input line by line to it.
    I tried the following :
    import java.io.*;
    class runtime
        static Process p;
        static BufferedReader stdOutput;
        static BufferedWriter stdInput;
        public static void main(String args[]) throws IOException
            int i = 0;
            try{
                String cmd[] = new String[] {"perl","arg.pl"};
                p = Runtime.getRuntime().exec(cmd,null,new File("./"));
                stdOutput = new BufferedReader(new InputStreamReader(p.getInputStream()));
                stdInput = new BufferedWriter(new OutputStreamWriter(p.getOutputStream()));
            catch(Exception ex){
                System.out.println("Unable to initiate Process : " + ex);
            stdInput.write("abcd\n");
            stdInput.flush();
            System.out.println(stdOutput.readLine());
            stdInput.write("1234\n");
            stdInput.flush();
            System.out.println(stdOutput.readLine());
            stdInput.write("efgh\n");
            stdInput.flush();
            System.out.println(stdOutput.readLine());
            stdInput.write("5678\n");
            stdInput.flush();
            System.out.println(stdOutput.readLine());
            stdInput.close();
    }This doesn't work well. It just halts without any output.
    Can anyone help me?
    Edited by: Vijayakrishna on Dec 5, 2007 8:30 AM

    Let me be more specific.
    I want to use a class which will look something like this.
    import java.io.*;
    public class FindAnswer{
        Process p;
        BufferedReader stdOutput;
        BufferedWriter stdInput;
        public FindAnswer()
            try{
                String cmd[] = new String[] {"perl","arg.pl"};
                p = Runtime.getRuntime().exec(cmd,null,new File("./"));
                stdOutput = new BufferedReader(new InputStreamReader(p.getInputStream()));
                stdInput = new BufferedWriter(new OutputStreamWriter(p.getOutputStream()));
            catch(Exception ex){
                System.out.println("Unable to initiate Process. Error: " + ex);
        public String getAnswer(String question)
            String answer = question;
            try{
                stdInput.write(question + System.getProperty("line.separator"));
                stdInput.flush();
                answer = stdOutput.readLine();
            catch(Exception ex){
                System.out.println("Exception. Error: " + ex);
            return answer;
        public void close()
            if (p != null) {
                try {
                    if (p.getInputStream() != null)
                        p.getInputStream().close();
                    if (p.getOutputStream() != null)
                        p.getOutputStream().close();
                    if (p.getErrorStream() != null)
                        p.getErrorStream().close();
                catch (Exception e) {
                    System.out.println("Exception in Closing Streams - " + e);
    }The perl program takes lot of initialization time. I dont want to run the program foreach question i have. I'll just create an object to this class and find and answer by passing question to the object's getAnswer method. Here, I dont know all the questions in the beginning itself. I'll know one by one only and I should find answer without terminating the process.
    Kindly help me in this.

  • Problem in running a program installed in SD Memor...

    Hi,
    I'm having problem to run an installed program in the SD card. When a choose to install a new program in the SD card, it work fine, after finish the intall process I can run the application with no problem. But after I shutdown the phone and start it again I can't run the application no more, the icon appears in the screen but I click on it and nothing happens. When I install the same application in the Phone Memory I don't have this problem, It always starts. Could some one help me to solve this problem.
    Thanks.

    Hi,
    You said that after ejecting the SD card and
    inserting it again,you can run the program from
    the SD card. This means that the issue has been
    solved. But if still persists, check the "Running
    applications menu" and see whether there are programs
    running in the background. If you see running programs,
    delete them, because running programms can sometimes
    cause similar problems.
    Regards.
    Fattan
    Message Edited by fattan on 11-Sep-2008 07:32 PM

  • Run a program from java code

    I want to run this program from my java code,
    In Linux(ubuntu) I write this command to open the program window
    $ paraFoam -case /home/saud/OpenFOAM/OpenFOAM-1.5/run/tutorials/icoFoam/cavity/In my java code I wrote it like this("/home/saud/OpenFOAM/OpenFOAM-1.5/bin/" is the path of the program):
    String command = "/home/saud/OpenFOAM/OpenFOAM-1.5/bin/paraFoam " +
              "-case /home/saud/OpenFOAM/OpenFOAM-1.5/run/tutorials/icoFoam/cavity/";
    final Process myProcess = Runtime.getRuntime().exec(command);
    BufferedReader buf = new BufferedReader(new InputStreamReader(
              myProcess.getInputStream()));
    String line;
    while ((line = buf.readLine()) != null) {
         System.out.print(String.format("%s\t\n", line));
    buf.close();
    int returnCode = myProcess.waitFor();
    System.out.println("Return code = " + returnCode); Return code = 0
    but the program is not opening
    Edited by: Saud.R on Apr 11, 2009 3:37 AM

    Welcome to the Sun forums.
    I am not sure of the answer to your question, but people who use Processes regularly, warn other users to ensure they are also doing something with the error stream of the process, otherwise it can hang as you describe.

  • Help! how to run other programs using java

    how can i run other programs or exe files using java, anyone can give sample codes for this.
    ex. if I click [run MsWord] button, then msWord automatically lunch

    RunTime.getRuntime().exec(string command)
    I guess, it might help you..java.lang.Runtime

  • Facing problem with running exe from my java code

    Hello,
    I have to run the exe from java code for which I m using Runtime and Process classes. The exe runs in the following way on command line
    C:/ myexe -j [now press enter]
    input sentence followed by ! [now press enter]
    And after this exe gives the output.
    So is there any way to achieve this programmatically in Java?
    Thanks in advance.
    Regards,

    I m confused .. how can i pass input to the Process through InputStream? I think it will need OutputStream for that.
    Here is my code...
    import java.io.*;
    class CallToExe
    static BufferedReader br;
    public static void main(String[] args)
    File F = new File("C:/Chasen.exe");
    try
    if( F.exists())
         System.out.println("Exe exists");
         Runtime rt = Runtime.getRuntime();
         Process proc = rt.exec("C:/chasen.exe");
         br = new BufferedReader(new InputStreamReader(in));
         int a = in.read();
         System.out.println(a);
         String res = br.readLine();
         System.out.println(res);     
         while(!res.equals(null))
         System.out.println(res);     
         res = br.readLine();
    proc.waitFor();
         proc.destroy();
    catch(NullPointerException npe)
         npe.printStackTrace();
    catch (Exception IOEx)
    IOEx.printStackTrace();
    But it doesnt work as my chasen.exe needs arguments from stdin.
    The way exe works is as follows.
    on command prompt>>
    C:/chasen.exe -j [ Need to press ENTER here]
    input statement . [ Need to press ENTER here too]
    Then output is displayed on command prompt which can be taken from InputStream of the process. But I m not able to properly run this exe itself with all the arguments frm Stdin

  • Problem while running dos command from java program

    Dear friends,
    I need to terminate a running jar file from my java program which is running in the windows os.
    For that i have an dos command to find process id of java program and kill by using tskill command.
    Command to find process id is,
    wmic /output:ProcessList.txt process where "name='java.exe'" get commandline,processid
    This command gives the ProcessList.txt file and it contains the processid. I have to read this file to find the processid.
    when i execute this command in dos prompt, it gives the processid in the ProcessList.txt file. But when i execute the same command in java program it keeps running mode only.
    Code to run this command is,
    public class KillProcess {
         public static void main(String args[]) {
              KillProcess kProcess = new KillProcess();
              kProcess.getRunningProcess();
              kProcess = new KillProcess();
              kProcess.readProcessFile();
         public void getRunningProcess() {
              String cmd = "wmic /output:ProcessList.txt process where \"name='java.exe'\" get commandline,processid";
              try {
                   Runtime run = Runtime.getRuntime();
                   Process process = run.exec(cmd);
                   int i = process.waitFor();
                   String s = null;
                   if(i==0) {
                        BufferedReader stdInput = new BufferedReader(new
                               InputStreamReader(process.getInputStream()));
                        while ((s = stdInput.readLine()) != null) {
                         System.out.println("--> "+s);
                   } else {
                        BufferedReader stdError = new BufferedReader(new
                               InputStreamReader(process.getErrorStream()));
                        while ((s = stdError.readLine()) != null) {
                         System.out.println("====> "+ s);
                   System.out.println("Running process End....");
              } catch(Exception e) {
                   e.printStackTrace();
         public String readProcessFile() {
              System.out.println("Read Process File...");
              File file = null;
              FileInputStream fis = null;
              BufferedReader br = null;
              String pixieLoc = "";
              try {
                   file = new File("ProcessList.txt");
                   if (file.exists() && file.length() > 0) {
                        fis = new FileInputStream(file);
                        br = new BufferedReader(new InputStreamReader(fis, "UTF-16"));
                        String line;
                        while((line = br.readLine()) != null)  {
                             System.out.println(line);
                   } else {
                        System.out.println("No such file");
              } catch (Exception e) {
                   e.printStackTrace();
              return pixieLoc;
    }     when i remove the process.waitFor(), then while reading the ProcessList.txt file, it says "No such file".
    if i give process.waitFor(), then it's in running mode and program is not completed.
    Colud anyone please tell me how to handle this situation?
    or Is there anyother way to kill the one running process in windows from java program?
    Thanks in advance,
    Sathish

    Hi masijade,
    The modified code is,
    class StreamGobbler extends Thread
        InputStream is;
        String type;
        StreamGobbler(InputStream is, String type)
            this.is = is;
            this.type = type;
        public void run()
            try
                InputStreamReader isr = new InputStreamReader(is, "UTF-16");
                BufferedReader br = new BufferedReader(isr);
                String line=null;
                while ( (line = br.readLine()) != null)
                    System.out.println(type + ">" + line);
                } catch (IOException ioe)
                    ioe.printStackTrace(); 
    public class GoodWindowsExec
        public static void main(String args[])
            try
                String osName = System.getProperty("os.name" );
                String[] cmd = new String[3];
                 if( osName.equals( "Windows 95" ) )
                    cmd[0] = "command.com" ;
                    cmd[1] = "/C" ;
                    cmd[2] = "wmic process where \"name='java.exe'\" get commandline,processid";
                } else {
                    cmd[0] = "cmd.exe" ;
                    cmd[1] = "/C" ;
                    cmd[2] = "wmic process where \"name='java.exe'\" get commandline,processid";
                Runtime rt = Runtime.getRuntime();
                System.out.println("Execing " + cmd[0] + " " + cmd[1]
                                   + " " + cmd[2]);
                Process proc = rt.exec(cmd);
                System.out.println("Executing.......");
                // any error message?
                StreamGobbler errorGobbler = new
                    StreamGobbler(proc.getErrorStream(), "ERROR");           
                          // any output?
              StreamGobbler outputGobbler = new
                    StreamGobbler(proc.getInputStream(), "OUTPUT");
                          // kick them off
                errorGobbler.start();
                outputGobbler.start();
                // any error???
                int exitVal = proc.waitFor();
                System.out.println("ExitValue: " + exitVal);       
            } catch (Throwable t)
                t.printStackTrace();
    }when i execute the above code, i got output as,
    Execing cmd.exe /C wmic process where "name='java.exe'" get commandline,processid
    and keeps in running mode only.
    If i execute the same command in dos prompt,
    CommandLine
    ProcessId
    java -classpath ./../lib/StartApp.jar;./../lib; com.abc.middle.startapp.StartAPP  2468
    If i modify the command as,
    cmd.exe /C wmic process where "name='java.exe'" get commandline,processid  > 123.txt
    and keeps in running mode only.
    If i open the file when program in running mode, no contents in that file.
    If i terminte the program and if i open the file, then i find the processid in that file.
    Can you help me to solve this issue?

  • Problem in running j2ee programs with SSL: SSL context init failed : cannot

    Hi,
    I am just trying to run some servlet program that creates some SSL socket to communicate with a server. I have configured my java.security file but when i run my rpogram i get this error
    SSL context init failed : cannot recover key.i am using SunJSSE provider
    Plz help me and i am confused as in how to enable jsse in my sun java system app server platform edition.
    Waiting for ur replies!
    Thanks,
    Akshatha

    I got this error last week.
    The problem was that the keystore I was pointing to, was in other location, so it could not initialize the default context.
    I had defined ...
    String CLIENT_CERTIFPATH = getParam("client.certificate.path", "/users/pridas/myKeystoreFile");
    // getParam extracts the location of the keystore from a text file which contains some configuration parameters. The default value will be /users/pridas/myKeystoreFile
    In my case, I will try to develop a secure SOAP conexion using certificates.
    Before to try the conexion, I defined ...
    System.setProperty("javax.net.ssl.trustStore", CLIENT_CERTIFPATH);
    System.setProperty("javax.net.ssl.keyStore", CLIENT_CERTIFPATH);
    ... and the problem when I got this error ... the keystore file was not in the correct location.
    That was how I resolved this error.
    I hope everybody will be oriented about this kind of errors.
    Salu2.

Maybe you are looking for

  • Importing the (active) Fix Asset with ◦Accumulated ordinary depreciation to Sap Business One 9

    Hi all, I'm trying to upload the  Active Fix Asset to the SBO (no new). for example: item:                          FixAsset Useful life :                48 (month) Remaining Life:        12 (month) APC(Historical cost): 10000 Accumulated Ordinary De

  • Popup-window in BSP

    Hello, I am new at BSP's so I hope someone can help me. When I click on button in a BSP-page i call a popup-window using something like this function Popup(url){   window.open(url,"MyPopup",'height=100,width=300'); In that new window there are 2 butt

  • What is the best option to get a wireless connection please?

    Hi, I have a 1.6 GHz G5 with Tiger (soon to install Leopard). I currently have broadband through an ethernet cable but I want to set up wireless. My understanding so far is that I need either an airport card or an external device such as airport expr

  • Mac Mail - No audio

    I own a 15" MBP running Yosemite 10.10.3 and ever since I have had it, intermittently there is no 'outgoing mail' or 'incoming mail' sounds. I am not a beginner at this, being on my second iMac and my second MBP, but this issue is one that has plague

  • Standby Database not working

    Hi I have created one standby DB for Oracle 10.1.0.2.0 on same server for the primary Db.As per Oracle docs I have configured everything but when I do logswitch on primary DB and then check the standby DB as... SELECT SEQUENCE#, FIRST_TIME, NEXT_TIME