Help needed on prepareStatement in java

Hi,
how to make a Generic prepareStatement to execute different or rather dynamic queries.
my idea is to have a table which will store query_id and query in it .
the user will pass a query_id and the program should pick the query from table and pass it to prepareStatement ..
please give yr ideas or suggestions..
thanks,

What do u mean by "dynamic Queries"???...
Your solution represents a set of predefined queries, If this is the case, your suggested solution is optimum..

Similar Messages

  • Help Needed with Computer Science Java Project!

    Hi everyone, im in my final year at uni, im implementing a board game in java. I've started programming it, but have the main part yet to do, which is the actual game play. I need someone to look at my code and give me a few pointers, or even better do it for me, all this of course after you read the game description and the project specification. Whoever maybe able to help please send me your email, and i will send you all that i have, i.e. the project proposal, game description, project specification, and the java files. Anyones help will be much appreciated and rewarded, i have only 3 - 4 weeks to complete this project and need to get a first for it. Therefore i need help urgently! You can email me at [email protected], many thanks!
    Mace

    Hi everyone, im in my final year at uni, im
    implementing a board game in java. I've started
    programming it, but have the main part yet to do,
    which is the actual game play. So, you're in your final year, and yet you still think the correct approach is to just sit down and start writing code without first figuring out what the major pieces will be and how they'll fit together. You haven't learned much then.
    I need someone to look
    at my code and give me a few pointers, or even better
    do it for me, Ah, you're one of those vile, disgusting, lowlife shitbuckets who thinks it's okay to take credit for others' work and phuck over your classmates in the process.
    I mean this sincerely: I hope you die soon. Before you have the chance to breed.

  • Help needed in printing in java

    hello everyone, i m in grave need of a solution of printing a java page. I have a page designed in Java swings which contains mainly labels and textareas. And i need to print this page. The problem is that I have no clue how to go ahead. Cud neone arnd pls help me on this matter asap as this is very urgent. I shall be highly obliged to all the takers on this issue. Please email me at [email protected]
    Thanks and kind regards,
    Rahul.

    http://java.sun.com/docs/books/tutorial/2d/printing/index.html

  • Help needed for Time Calc Java Script

    Hi,
    I am trying to create a timesheet in PDF and have hit a speed bump. Is there anyone there who could provide me with a script that calculated the difference between 2 times? (Field2 time)-(Feild 1 Time) = Duration.I am desperate and have tried everything.
    I proccess the payroll for a company and all of the 500 or so timesheets that I received each fortnight are paper copies and I am pulling my hair out. I need to use Adobe forms (We have Adobe Pro 9 and I am using the XML forms, not live cycle) as the serach engine that we use for emails cannot search on excel documents.
    I have no Java script experience and I am getting completely lost in the subject. Any help would be greatly appreciated.
    Thanks anyone who can help at all.
    -Sohnia

    hi friend here example for time calulation start and end time example..<br />just copy and paste then run it ur browser.<br /><br /><HTML><br /><script language="JavaScript"><br /><!--<br /><br />var h1 = 1;<br />var h2 = 2;<br />var days = 0;<br />var m1 = 1;<br />var m2 = 2;<br />var am1 = 1;<br />var am2 = 2;<br />function findtime(h1,h2,days,m1,m2,am1,am2)<br />{<br />var answer = "why";<br />var mdiff = 1;<br />var hdiff = 2;<br />pdays = parseInt(days);<br />ph1 = parseInt(h1);<br />ph2 = parseInt(h2);<br />pm1 = parseInt(m1);<br />pm2 = parseInt(m2);<br />if(am1 == 2 & ph1 < 12) ph1 = ph1 + 12;<br />if(am2 == 2 & ph2 < 12) ph2 = ph2 + 12;<br />if(am1 == 1 & ph1 == 12) ph1 = 24;<br />if(am2 == 1 & ph2 == 12) ph2 = 24;<br />if(am1 == 2 & am2 == 1 & ph2 < 24) ph2 = ph2 + 24;<br />if(am1 == am2 & ph1 > ph2) ph2 = ph2 + 24;<br />if(pm2 < pm1){<br />pm2 = pm2 + 60;<br />ph2 = ph2 - 1;<br />}<br />mdiff = pm2 - pm1;<br />hdiff = (ph2 - ph1) + (pdays * 24);<br />if(hdiff == 0) answer = mdiff + ' minutes';<br />else if(hdiff == 1) answer = '1 hour and ' + mdiff + ' minutes'<br />else answer = hdiff + ' hours and ' + mdiff + ' minutes'<br />return answer<br />}<br /><br />//--><br /></script><br /></HEAD><br /><br /><font face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular"><br /><BODY BGCOLOR=FFFFFF TEXT=000000 LINK=0000FF VLINK=800080><br /><br /><div align="center"><table width="950" border="0" cellpadding="0" bgcolor="#899194" cellspacing="0"><br /><br />  <br /><tr><td valign="middle" width="33%"><br /><br /><center><br /><form><br /><TD WIDTH=80%><br /><center><br /><TABLE ALIGN=MIDDLE BORDER=5 CELLPADDING=5><br /><TR BGCOLOR=#FFFFFF><br /><!--ROW 1--><br /><TD WIDTH=80%><br /><center><br /><TABLE ALIGN=MIDDLE BORDER=5 CELLPADDING=5><br /><TR BGCOLOR="#B6D4D2"><br /><!--ROW 1--><br /><td colspan=4><br /><center>Time Between Times Calculations - Multiple Days</center><br /><br /></td><br /></tr><br /><TR BGCOLOR="#B6D4D2"><br /><TD align="center" colspan=4><br />Required Data Entry<br /></td><br /></tr><br /><tr><br /><td align="center">Start / End</td><br /><td align="center">Hour</td><br /><td align="center">Minute</td><br /><td align="center">AM / PM</td><br /></tr><br /><br /><td align="center">Start time</td><br /><td align="center"><input type="text" name="hour1" size="5"></td><br /><td align="center"><input type="text" name="minute1" size="5"></td><br /><td align="center"><select name="period1"><br /><option value="1">AM<br /><option value="2">PM<br /></select><br /></td><br /></tr><br /><tr><br /><td colspan="3">    Add Complete Interim Days</td><td align="center"><input type="text" name="adays" size="5" value="0"></td><br /></tr><br /><tr><br /><td align="center">Start / End</td><br /><br /><td align="center">Hour</td><br /><td align="center">Minute</td><br /><td align="center">AM / PM</td><br /></tr><br /><td align="center">End time</td><br /><td align="center"><input type="text" name="hour2" size="5"></td><br /><td align="center"><input type="text" name="minute2" size="5"></td><br /><td align="center"><select name="period2"><br /><option value="1">AM<br /><option value="2">PM<br /></select><br /></td><br /></tr><br /><br /><tr><br /><td align="center" colspan=4 BGCOLOR="#B6D4D2"><br /><input type="button" value="Calculate" <br />onclick="h1=form.hour1.value;<br />h2=form.hour2.value;<br />m1=form.minute1.value;<br />m2=form.minute2.value;<br />days=form.adays.value;<br />am1=form.period1.options[period1.selectedIndex].value;<br />am2=form.period2.options[period2.selectedIndex].value;<br />if(h1 < 0 | h1 > 12) alert('Your start hour is not valid');<br />else if(h2 < 0 | h2 > 12) alert('Your end hour is not valid');<br />else if(m1 < 0 | m1 > 59) alert('Your start minute is not valid');<br />else if(m2 < 0 | m2 > 59) alert('Your end minute is not valid');<br />else form.answer.value=findtime(h1,h2,days,m1,m2,am1,am2);"><br />   <br /><input type="reset" value="Clear Values"><br /><br /></td><br /></tr><br /><TR BGCOLOR="#B6D4D2"><br /><TD align="center" colspan=4><br />Calculated Results<br /></td><br /></tr><br /><br /><tr><br /><td align="center" colspan="4"><br />Time Difference <input type="text" name="answer" size="40"><br /><tr><td>[email protected]</td></tr><br /></td><br /></tr><br /></table><br /></form><br /></td><br /></tr><br /></table><br /><br /></center><br /></td><br /></tr><br /></table><br /></center><br /><br /></TD><br /></TR><br /></TABLE><br /></BODY> <br /></HTML>

  • Help needed to move a java.rmi.Remote object.....

    Hi,
    I have an object extending java.rmi.Remote on a server. I want to get it onto a client (ie the actual object, not a reference to the object on the server).
    The catch (isn't there always one):
    The client must only get class definitions/interface definitions from the java.rmi.server.codebase
    (ie I don't want to use a network classloader).
    Anyone any ideas?
    Kev.

    If you have a class that implements java.rmi.Remote then the objects of that class by definition are available for Remote access (ie, they are passed by reference). Remote objects can't be passed by value. However, if you want objects of a particular class to be passed by value you could have the class implement java.io.Serializable instead of java.rmi.Remote.
    Hope this helps.

  • Help needed on a TicTacToe java program

    I am very new to java and our teacher has given us a program
    that i am having quite a bit of trouble with. I was wondering if anyone could help me out.
    This is the program which i have bolded.
    {You will write a Java class to play the TicTacToe game. This program will have at least two data members, one for the status of the board and one to keep track of whose turn it is. All data members must be private. You will create a user interface that allows client code to play the game.
    The user interface must include:
    �     Boolean xPlay(int num) which allows x to play in the square labeled by num. This function will return true if that play caused the game to end and false otherwise.
    �     Boolean oPlay(int num) which allows o to play in the square labeled by num. This function will return true if that play caused the game to end and false otherwise.
    �     Boolean isEmpty(int num) will check to see if the square labeled by num is empty.
    �     Void display() which displays the current game status to the screen.
    �     Char whoWon() which will return X, O, or C depending on the outcome of the game.
    �     You must not allow the same player to play twice in a row. Should the client code attempt to, xPlay or oPlay should print an error and do nothing else.
    �     Also calling whoWon when the game is not over should produce an error message and return a character other than X, O, or C.
    �     Client code for the moment is up to you. Assume you have two human players that can enter the number of the square in which they want to play.
    Verifying user input WILL be done by the client code.}

    Hi,
    This forum is exclusively for discussions related to Sun Java Studio Creator. Please post your question at the Java Programming forum. The URL to this forum is:
    http://forum.java.sun.com/forum.jspa?forumID=31
    Cheers
    Giri

  • Help needed in voice enabled java app on LINUX OS

    I have problem in capturing voice from mic on Linux m/c with in java application. I tried that by using native app on linux. It is working fine, but when i tried to make it work with a java application, it is not working.
    Any help is appreciated. Thanks in Advance...
    -Bhaskar

    I have the same problem, I'm able to receive RTP audio, but not send, I have Red Hat linux 9

  • Help needed- Check hardware with java

    Hi everyone:)
    I'm working on a colledge project and i need to know if anybody knows a way to check hardware's capabilities using java, i.e. i want to use java to check if a machine can play a sound clip, or has enough free space, etc...
    Can someone please point me some clues on how to get there (prefeberably using J2ME)?
    Thanks in advance,
    Pedro

    Download the SAP Java connector (JCo).
    This has documentation and sample code to get you started.

  • Help needed, segmentation fault with java 1.6

    Hey, I would very much appreciate help with this problem.
    It began a while ago, while I was using Netbeans 6.5 to do some Java Server testing stuff, I was running Adobe Flash on top (working on some WSDL stuff), and the computer was understandable running a bit slowly. However, it got to the point where the computer stopped responding, even with me killing apps as often as possible to conserve memory (1 GB on this machine) and I was forced to kill the machine by holding down the power button (using a white MacBook). When I started up once more, java 1.6 was dead, no amount of re-installs seemed to be helping when I tried downloading the Java Updates from Apple, though java 1.5 seemed to be working at that time. However, poking around in the console and looking at the logs, I noticed that launchd[1] was failing every 10 seconds to start something up, it looked like it was the apache http server, therefore I went to System Preferences to turn of Web Sharing, and that particular problem disappeared. However, whenever I would attempt to run java, even using the Terminal, I would get this Console log, or at least one very similar (this one was generated with java 1.5 I believe)
    Process: java [7217]
    Path: /usr/bin/java
    Identifier: java
    Version: ??? (???)
    Code Type: X86-64 (Native)
    Parent Process: bash [7208]
    Date/Time: 2008-12-13 10:41:23.197 -0500
    OS Version: Mac OS X 10.5.5 (9F33)
    Report Version: 6
    Exception Type: EXCBADACCESS (SIGSEGV)
    Exception Codes: 0x000000000000000d, 0x0000000000000000
    Crashed Thread: 0
    Thread 0 Crashed:
    0 libSystem.B.dylib 0x00007fff80e57164 strcmp + 84
    1 libobjc.A.dylib 0x00007fff8000b23f _selregisterName + 49
    2 libobjc.A.dylib 0x00007fff8000ab46 map_images + 3757
    3 dyld 0x00007fff5fc04130 dyld::notifyBatchPartial(dyldimagestates, bool, char const* (*)(dyldimagestates, unsigned int, dyldimageinfo const*)) + 416
    4 dyld 0x00007fff5fc048fd dyld::registerImageStateBatchChangeHandler(dyldimagestates, char const* (*)(dyldimagestates, unsigned int, dyldimageinfo const*)) + 525
    5 libSystem.B.dylib 0x00007fff80e56472 dyldregister_image_state_changehandler + 88
    6 libobjc.A.dylib 0x00007fff8000954f objcinit + 38
    7 dyld 0x00007fff5fc11257 ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 279
    8 dyld 0x00007fff5fc0d16c ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int) + 268
    9 dyld 0x00007fff5fc0d110 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int) + 176
    10 dyld 0x00007fff5fc0d110 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int) + 176
    11 dyld 0x00007fff5fc0d110 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int) + 176
    12 dyld 0x00007fff5fc0d254 ImageLoader::runInitializers(ImageLoader::LinkContext const&) + 52
    13 dyld 0x00007fff5fc038b4 dyld::initializeMainExecutable() + 132
    14 dyld 0x00007fff5fc06eb1 dyld::main(machheader const*, unsigned long, int, char const**, char const**, char const**) + 2209
    15 dyld 0x00007fff5fc01695 dyldbootstrap::start(mach_header const*, int, char const**, long) + 693
    16 dyld 0x00007fff5fc0103a dyldstart + 42
    Thread 0 crashed with X86 Thread State (64-bit):
    rax: 0x00000000000008a0 rbx: 0x00007fff80018760 rcx: 0x0000000000005722 rdx: 0x000000000000008a
    rdi: 0x00007fff80018760 rsi: 0x0c00004806000038 rbp: 0x00007fff5fbfdbc0 rsp: 0x00007fff5fbfdba8
    r8: 0x00000000c5a8037d r9: 0x0000000068e33de7 r10: 0x00000000bcafe771 r11: 0x0000000000000001
    r12: 0x0c00004806000038 r13: 0x0000000000000001 r14: 0x0000000000000001 r15: 0x000000000000001d
    rip: 0x00007fff80e57164 rfl: 0x0000000000010202 cr2: 0x00007fff7002f9f0
    Binary Images:
    0x100000000 - 0x10000afe0 +java ??? (???) <53c91321e79d660f62c011f5d8625a7f> /usr/bin/java
    0x100010000 - 0x100018ffd com.apple.JavaVM 12.2.0 (12.2.0) <2b178e8d4bbcc0aa427c2f3f71bb2fcb> /System/Library/Frameworks/JavaVM.framework/Versions/A/JavaVM
    0x7fff5fc00000 - 0x7fff5fc2e593 dyld 96.2 (???) <b0570939de4a19f478c8eabab95aaaee> /usr/lib/dyld
    0x7fff80003000 - 0x7fff800f7fff libobjc.A.dylib ??? (???) <118dc1ae05e685ad64290352fc94f1f0> /usr/lib/libobjc.A.dylib
    0x7fff80199000 - 0x7fff801aaffd libz.1.dylib ??? (???) <f260db32dd97a14108a5e04184785ded> /usr/lib/libz.1.dylib
    0x7fff801ab000 - 0x7fff801e8ff7 com.apple.SystemConfiguration 1.9.2 (1.9.2) <3e058b95c78dc2f54ec3f9781bd86e1c> /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfi guration
    0x7fff801e9000 - 0x7fff80239fe7 com.apple.Metadata 10.5.2 (398.22) <1fc60b4568a7ffbec4273f656d61ab58> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadat a.framework/Versions/A/Metadata
    0x7fff808c2000 - 0x7fff80957ffb com.apple.LaunchServices 290 (290) <b5b494e44b291a782bee370a046d5727> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchS ervices.framework/Versions/A/LaunchServices
    0x7fff80a31000 - 0x7fff80a39ffa libbsm.dylib ??? (???) <4d838c0d8a74fe61c781a53a8723303d> /usr/lib/libbsm.dylib
    0x7fff80a3a000 - 0x7fff80a6cff7 libauto.dylib ??? (???) <cc8eece8c0097b254c758bd4e8df9537> /usr/lib/libauto.dylib
    0x7fff80e4d000 - 0x7fff80fd1ffb libSystem.B.dylib ??? (???) <8e3de87ccdf6c4606b9bcb9da3a33eda> /usr/lib/libSystem.B.dylib
    0x7fff80fd2000 - 0x7fff81046fe7 libstdc++.6.dylib ??? (???) <565ee6f798f7fef6f804c60682787280> /usr/lib/libstdc++.6.dylib
    0x7fff81075000 - 0x7fff81106fff com.apple.SearchKit 1.2.1 (1.2.1) <e2a25e04f281fe8ff7088a08a549020f> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchK it.framework/Versions/A/SearchKit
    0x7fff81107000 - 0x7fff8119bfe3 com.apple.CFNetwork 339.5 (339.5) <6e912954955e0af0e0defb59cc2c348a> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CFNetwo rk.framework/Versions/A/CFNetwork
    0x7fff814b5000 - 0x7fff814dcfff libxslt.1.dylib ??? (???) <22a74e7859cfbf63ae7fc310b0a669a4> /usr/lib/libxslt.1.dylib
    0x7fff82112000 - 0x7fff82249fff com.apple.CoreFoundation 6.5.4 (476.15) <4b970007410b71eca926819f3959548f> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
    0x7fff8224a000 - 0x7fff8224affa com.apple.CoreServices 32 (32) <c12e589173b697ce88050a6f736549eb> /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
    0x7fff830ae000 - 0x7fff830edfef com.apple.framework.IOKit 1.5.1 (???) <56d5528f3623ad4d9c68751018e658c3> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
    0x7fff832b0000 - 0x7fff83360fef com.apple.CoreServices.OSServices 226.5 (226.5) <4461ef69cec249de2315c88e83d4c904> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServi ces.framework/Versions/A/OSServices
    0x7fff83465000 - 0x7fff835d3fff libicucore.A.dylib ??? (???) <25557e76cafa3f8a97ca7bffe42e2d97> /usr/lib/libicucore.A.dylib
    0x7fff835d8000 - 0x7fff835dcfff libmathCommon.A.dylib ??? (???) /usr/lib/system/libmathCommon.A.dylib
    0x7fff835f5000 - 0x7fff8360dfff com.apple.DictionaryServices 1.0.0 (1.0.0) <78ea11e9a92120f76d69efa24b8d1f95> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Diction aryServices.framework/Versions/A/DictionaryServices
    0x7fff836a5000 - 0x7fff8379afff libxml2.2.dylib ??? (???) <8226d1180354f493954c5fa1fc0e1154> /usr/lib/libxml2.2.dylib
    0x7fff8379b000 - 0x7fff837a1fff com.apple.DiskArbitration 2.2.1 (2.2.1) <e75fe224700767869227cc903bef8ed9> /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
    0x7fff8387a000 - 0x7fff83a80ffb com.apple.security 5.0.4 (34102) <e0b73ab106139601404f2666ce1b9d65> /System/Library/Frameworks/Security.framework/Versions/A/Security
    0x7fff83ecb000 - 0x7fff84165fe3 com.apple.Foundation 6.5.6 (677.21) <8995b3185ca91d3508c7580794d40813> /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
    0x7fff84166000 - 0x7fff841a1fff com.apple.AE 402.2 (402.2) <b03583e0747f82199e0d9604014faa34> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.fram ework/Versions/A/AE
    0x7fff842ed000 - 0x7fff842f9ff1 libgcc_s.1.dylib ??? (???) <23fa31a628c1ea8a62ac529fa333b6e1> /usr/lib/libgcc_s.1.dylib
    0x7fff842fa000 - 0x7fff84382fe7 libsqlite3.0.dylib ??? (???) <3c7ab3523b816dbd3e039ee7e6e2c580> /usr/lib/libsqlite3.0.dylib
    0x7fff84383000 - 0x7fff8467efe3 com.apple.CoreServices.CarbonCore 786.6 (786.6) <7048aee00133f19029108600e9ede844> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonC ore.framework/Versions/A/CarbonCore
    0x7fffffe00000 - 0x7fffffe01780 libSystem.B.dylib ??? (???) /usr/lib/libSystem.B.dylib
    0xfffffffffffec000 - 0xfffffffffffeffff libobjc.A.dylib ??? (???) /usr/lib/libobjc.A.dylib
    As I said, java 1.5 worked for a while, however recently it too has stopped working and spits out Segmentation Faults like these. Any clues as to why, and how to fix?
    Much thanks.

    I have no answers, but strongly suggest posting to an appropriate forum under OS X Technologies, where Unix and developer gurus hang out.

  • Install problems - help needed desperately for new Java user

    I have been trying to install Java SE Development Kit 6 - Version 1.6.0_13. Initially I could not get the javac process to work no matter what I tried. After uninstalling and reinstalling numerous times I now have it so that my javac will rewrite my file from a .java to a .class file. Now when I try to execute my Hello.class file I am getting an error message....
    Error occurred during initialization of VM
    java/lang/NoClassDefFoundError: java/lang/Object
    Can anyone please help me fix this? I was really anxious to learn programming but all of these setbacks are really frustrating. I have basic books to help when I am up and running but nothing helps you with problems with installations.
    Please help!!!

    Enigmafae wrote:
    Thank you so much. Worked like a charm! I also installed from Explorer instead of Firefox. Maybe the Firefox installations were incompatible with my XP Environment????Worked fine for me... but I downloaded and then installed... I did NOT "run" the install over the network.
    I don't care I'm just so thrilled it worked. Now I can get to learning the actual programming that I have been trying to get to.
    Thx again for your help!I love it when a plan comes together.
    ~~ Hannibal.

  • HELP NEED FOR INVOKING THE JAVA CODE INSIDE JSP

    Hello,
    any one knows how to Write a java code inside the .jsp files... please if any one knows it please ....help me .....

    hi .
    Use scriptlets , for example :
    <html>
    <%
    int x;
    for(x=1;x<=5;x++)
    out.println(x);
    %>
    </html>

  • Help needed in running a  java program

    hi
    how to run a java program using another java program.
    i have tried a litte to run the notepad,mspaint applications sucessfully using the Runtime class,but how to specify a java program init . the program is given below
    public class cls
    public static void main(String args[])
      Runtime r=Runtime.getRuntime();
      Process p=null;
      try{
        p=r.exec("notepad" );}
        catch(Exception e) {
        System.out.println("error on execution");
    }to run another java program how to modify the exec() or any other way to do this.

    thank u
    its working without any error but it doesn't print any thing on the screen.
    the program is
    this program to be run by cls.java
                                             // hello.java
    import java.io.*;
    public class hello
    public static void main(String[] args)
        System.out.println("hello world");
      }cls.java is given below
                                                    //cls.java
    public class cls
    public static void main(String args[])
      Runtime r=Runtime.getRuntime();
      Process p=null;
      try{
        p=r.exec("java  hello" );}
        catch(Exception e) {
        System.out.println("error on execution");
    }

  • Help needed in understanding the Java code.

    Hi All,
    I have recently started learning the Java language. I came across this example and had a problem in understanding the output of the program. I could follow that if the continue statement is present in the below program the output is "Found 9 p's in the string" . But if the continue statement is removed I could not understand why the output would be "Found 35 p's in the string" .Is it because of the spaces and characters other than p... (eter ier icked a eck of ickled eers)
    Example-----------------------
    The continue statement skips the current iteration of a for, while , or do-while loop. The unlabeled form skips to the end of the innermost loop's body and evaluates the boolean expression that controls the loop. The following program, ContinueDemo , steps through a String, counting the occurences of the letter "p". If the current character is not a p, the continue statement skips the rest of the loop and proceeds to the next character. If it is a "p", the program increments the letter count.
    class ContinueDemo {
    public static void main(String[] args) {
    String searchMe
    = "peter piper picked a " +
    "peck of pickled peppers";
    int max = searchMe.length();
    int numPs = 0;
    for (int i = 0; i < max; i++) {
    // interested only in p's
    if (searchMe.charAt(i) != 'p')
    continue;
    // process p's
    numPs++;
    System.out.println("Found " +
    numPs + " p's in the string.");
    Here is the output of this program:
    Found 9 p's in the string.
    To see this effect more clearly, try removing the continue statement and recompiling. When you run the program again, the count will be wrong, saying that it found 35 p's instead of 9.

    The answer is already in your example - "The unlabeled form skips to the end of the innermost loop's body and evaluates the boolean expression that controls the loop."
    It unloads the current loop iteration when condition is matching. Loop is again starting from boolean expression inside loop declaration.
    Java Programming - java forum

  • Help needed in executing the java/jsp program from UCM .

    Hi ,
    I have a .jsp program running in my Jdeveloper which when executed pops a window to browse and select files and with few custom options .
    But i want to execute that Program from within UCM (create a new jsp page in UCM OR provide link ? i am not sure .... ) , could anyone help on how i can execute/run the program from UCM ?
    thanks in Advance
    Plaxman

    If your jsp makes use of jars you may want to look into using a WAR instead. You can check the WAR into content server and there is even a link on the administration page for JSP Web App Admin. Treating the JSP(s) and jar(s) as an entity may be a more successful path for you.
    You can find some jsp examples and ever a war example in this directory: <install root>\samples\JspServer
    And the briefest of help about that stuff here: [http://localhost/idc/help/wwhelp/wwhimpl/js/html/wwhelp.htm|http://localhost/idc/help/wwhelp/wwhimpl/js/html/wwhelp.htm]

  • HELP NEeded in creating tis java program

    create a prompter appliation that prompts the user for two numbers. The first number is a minimum value, and the second is a maximum value. Prompter then prompts the user for a number between the minimum and maximum numbers entered. The user should be continuously prompted until a number within the range is entered. Be sure to include the minimum and maximum numbers in prompt.
    use boolean operator in while loop
    what do do??

    so can some 1 help me"Help" as in provide workable code? They might - you did all right in your last
    thread. Personally, though, I doubt you're much helped by this.
    Start by reading the description of what your code must do. Make sure you
    understand the description - perhaps by explaining it in your own words to someone
    else. If they don't understand then you don't understand: not in any sense
    that matters.
    Then proceed to write some code. The first sentence of the description you posted
    makes a good starting point. Write some code that compiles and does this.
    Make sure you understand what each line does before moving on.
    If you get stuck post some code and an actual question. If there is a compiler error,
    copy paste and post the actual error you can't understand and say which line it refers
    to. If your code compiles but has unwanted, unexpected or mysterious results,
    say what it does and what you were expecting, or wanting.
    Hope that helps.
    (My apologies if your native language is not English, but really. Use a
    dictionary - online or, better, in paper form. Eschew abbreviations. Read what you
    post aloud or, as above, to someone else who can tell you if it makes no sense.)

Maybe you are looking for

  • I tried updating to iso 8.0.2 and now my ipad is stuck in recovery mode and will not do anything. it will not reset.

    I tried updating to iso 8.0.2 and now my iPad is stuck in recovery mode and will not do anything. it will not reset.

  • Remove the updates Installed to the client from WSUS SERVER

    WSUS Server running on the Windows Server 2008 R2. Is there a way to get rid of updates that have been pushed out and installed on all client computers? because currently I am running out of disk space and I really don't want to increase the disk spa

  • Photoshop not coming to front?

    I couldn't find this problem with the search feature so bear with me if this has already been discussed. Browsing in Bridge I double click a CR2 file and it opens in ACR. I click Open Image and Photoshop CS5 loads in the forefront and the image is op

  • Can't find MobileMe account

    When I input my mobileme account name to try and set up MobileMe on the AppleTV, for some reason it says that it cannot find the account. I have done it the "correct way" (without me.com on the end), as well as with the me.com to make sure. I know th

  • Find not working on large external drive

    I have several external HDD attached using a FireWire daisychain including a new(ish) 500GB LaCie. When I use the Finder>File>Find function it only finds copies on the main drive and the older externals (not the laCie). Any ideas what's up? LaCie D2