Java if statment and == opperator

Why the crap is the statement inside of my if being reached?!!
if(1==10);
{     //log.info(Integer.toString(columnCounter));
return columnCounter;
How is 1 equal to 10?

Christmas Crackers?*boom                                                                                                                                                                                                                                   

Similar Messages

  • Problem with java.sql.Clob and oracle.sql.CLOB

    Hi,
    I am using oracle9i and SAP web application server. I am getClob method and storing that in java.sql.Clob and using the getClass().getName() I am getting the class name as oracle.sql.CLOB. But when I am trying to cast this to oracle.sql.CLOB i am getting ClassCastException. The code is given below
    java.sql.Clob lOracleClob = lResultSet.getClob(lColIndex + 1);
    lPrintWriter = new PrintWriter(new BufferedWriter (((oracle.sql.CLOB) lOracleClob).getCharacterOutputStream()));
    lResourceStatus = true;
    can anybody please tell me the what is the problem with this and solution.
    thanks,
    Ashok.

    Hi Ashok
    You can get a "ClassCastException" when the JVM doesn't have access to the specific class (in your case, "oracle.sql.CLOB").
    Just check your classpath and see if you are referring to the correct jar files.
    cheers
    Sameer
    PS: Please award points if you find the answer useful

  • Problem with java swing button and loop

    Problem with java swing button and loop
    I�m using VAJ 4.0. and I�m doing normal GUI application. I have next problem.
    I have in the same class two jswing buttons named start (ivjGStart) and stop (ivjGStop) and private static int field named Status where initial value is 0. This buttons should work something like this:
    When I click on start button it must do next:
    Start button must set disenabled and Stop button must set enabled and selected. Field status is set to 1, because this is a condition in next procedure in some loop. And then procedure named IzvajajNeprekinjeno() is invoked.
    And when I click on stop button it must do next:
    Start button must set enabled and selected and Stop button must set disenabled.
    Field status is set to 0.
    This works everything fine without loop �do .. while� inside the procedure IzvajajNeprekinjeno(). But when used this loop the start button all the time stay (like) pressed. And this means that a can�t stop my loop.
    There is java code, so you can get better picture:
    /** start button */
    public void gStart_ActionEvents() {
    try {
    ivjGStart.setEnabled(false);
    ivjGStop.setEnabled(true);
    ivjGStop.setSelected(true);
    getJTextPane1().setText("Program is running ...");
    Status = 1;
    } catch (Exception e) {}
    /** stop button */
    public void gStop_ActionEvents() {
    try {
    ivjGStart.setEnabled(true);
    ivjGStart.setSelected(true);
    ivjGStop.setEnabled(false);
    getJTextPane1().setText("Program is NOT running ...");
    Status = 0;
    } catch (Exception e) {
    /** procedure IzvajajNeprekinjeno() */
    public void IzvajajNeprekinjeno() {  //RunLoop
    try {
    int zamik = 2000; //delay
    do {
    Thread.sleep(zamik);
    PreberiDat(); //procedure
    } while (Status == 1);
    } catch (Exception e) {
    So, I'm asking what I have to do, that start button will not all the time stay pressed? Or some other aspect of solving this problem.
    Any help will be appreciated.
    Best regards,
    Tomi

    This is a multi thread problem. When you start the gui, it is running in one thread. Lets call that GUI_Thread so we know what we are talking about.
    Since java is task-based this will happen if you do like this:
    1. Button "Start" is pressed. Thread running: GUI_Thread
    2. Event gStart_ActionEvents() called. Thread running: GUI_Thread
    3. Method IzvajajNeprekinjeno() called. Thread running: GUI_Thread
    4. Sleep in method IzvajajNeprekinjeno() on thread GUI_Thread
    5. Call PreberiDat(). Thread running: GUI_Thread
    6. Check status. If == 1, go tho 4. Thread running: GUI_Thread.
    Since the method IzvajajNeprekinjeno() (what does that mean?) and the GUI is running in the same thread and the event that the Start button has thrown isn't done yet, the program will go on in the IzvajajNeprekinjeno() method forever and never let you press the Stop-button.
    What you have to do is do put either the GUI in a thread of its own or start a new thread that will do the task of the IzvajajNeprekinjeno() method.
    http://java.sun.com/docs/books/tutorial/uiswing/index.html
    This tutorial explains how to build a multi threaded gui.
    /Lime

  • Help! java wont download and I NEED it!

    Okay so I have tried to download every version of java I can and none of them are working and I need it for my website. I have os x 10.4.8 Tiger so I don't know why it won't work. Can anyone please help me out with this? Thank You.

    Well java should be installed by default as part of Mac OS X. I'm pretty sure both the Java runtime environment AND the software development kit should be included. Maybe be more specific with your question, I might be missing something.

  • Help needed with Java 1.4 and xml Runtime problem

    I am working on a java 1.3 and JAXP1.1 written code. Now I want to compile and run it using J2SE 1.4. Here are the import statements from the existing code.
    import org.xml.sax.*;
    import org.xml.sax.helpers.DefaultHandler;
    import org.xml.sax.Locator;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import org.xml.sax.Attributes;
    import org.xml.sax.XMLReader;
    import org.xml.sax.InputSource;
    import java.sql.*;
    import java.net.*;
    import java.io.*;
    When I run the existing(using java 1.3 and Jaxp1.1) code I have to include the files crimson.jar and jaxp.jar in the windows 2000 CLASSPATH and works fine.
    But when I compile and run it using J2SE 1.4 which has the built in support for the saxp, I thought that I don't have to specify any CLASSPATH for the new 1.4 so I don't specify any Classpath and it gives me the Microsoft "ClassFactory cannot find the requested class" error which means that even thought the new java 1.4 has the xml classes as libraries yet it still requies some .jar files to be listed in the CLASSPATH.
    If I am right then what path will work(i.e what jar class I need to add to the CLASSPATH).
    Thanks for your help.
    RA.

    Thanks for your reply,
    I think I didn't specify when the error occurs. The ClassFactory related error occurs when I run the program, it compiles without any error.
    From what I understood somewhere in the java 1.4 docs, that the new 1.4 has the xml libraries built in by default so one doesn't need to give the classpaths just like we don't give any CLASSPATH for using swing and many of the other java packages. That is one thing.
    Second thing is that I also tried to use the java_xml_pack-spring02 and java_xml_pack-summer02; but non of them include the crimson.jar and the jaxp.jar files in them which are the 2 .jar files that makes the program run fine when used under the java 1.3 with combination of the jaxp1.1(which was downloaded seperately and then the CLASSPATH for it was set.).
    Can you please help what .jar files do I need to use instead. I tried to use the ones that the new java_xml_pack-spring02 and java_xml_pack-summer02 has for the jaxp in them.
    Thanks again.
    RA

  • How can i use the AND opperator to AND to arrays

    hi, i have two large arrays of booleans and i need to copy all the true values from array 1 to array2 without losing the trues that are already in array 2. From my knowledge of asm, i know that using the AND opperator is perfect for this, seeing as each boolean only takes one bit.
    Searching and is kinda useless, so my search failed, could someone give me a quick code example, say x = 1 AND 2 or something. Thats all i need, thanks.
    PS: x should = 3
    Message was edited by:
    dead

    thanks guys, and btw, if your trying to join two arrays like i am, its OR, not AND, lol woops, not enough coffee.
    EDIT: now ive just been playing around and it appears you cant OR arrays, im guessing theres no way around this than to just increment through each one. This code needs to be as fast as possible as its in a loop, so if anyone who has a lot of experience with computers has a better way please let me know. I was originally going to make my code in assembler, and just read the array as an qword and OR it, then read it as an array again, but to be truthful im not entirely sure if its faster to to OR a qword once or a bit 64 times, lol.

  • Why not Deprecate java.util.Date and java.util.Calendar

    With the introduction of java.time, why did you not flag java.util.Date and java.util.Calendar. These classes have been a bane to every Java developer and should never be used again with the introduction of Java 1.8.

    Adding the @Deprecated annotation would only just provide a warning about an old API and recommendation to the developer(s) to no longer use it. Doing so would not break any existing library out there; in fact quite a number of constructors and methods on the Date class have already been flagged deprecated.
    The new java.time package is far superior to Date/Calendar.

  • Possible to extend java Concurrent Program and replace standard??

    Hi All!
    i have following developing need. There is a java concurrent program POXPOPDF (PO Output for Communication). The customer needs this program to do actually something complete different than printing the PO in PDF. The executable for this CP is java class PoGenerateDocumentCP in oracle.apps.po.communicate package.
    We thought that we may be able to extend that class and then in some way made OA to use the extended java class instead of the standard. This is possbile and simple for OA Framework pages unsing classes as controllers, but I don't know how it could be done for CP (if there's a way to do it without violent intervention in standard system).. Is it possbile, can anyone help me with this.
    The thing is that instead of reformatting the XML returned from PO_COMMUNICATION_PVT.POXMLGEN (function POXMLGEN in database package PO_COMMUNICATION_PVT) into PDF we want to reformat into another XML and then send it in other way to a webservice. Once I have the XML from POXMLGEN I have no problem to reformat it into another XML (I think, I have done it iwith other issues/processes). The webservice and the call to it is no problem and is already use with other purposes in other processes, but here (replaceing this stadard java class for an extension/new one) I am a little lost.
    Appreciate very much your help.
    Regards,
    Patricia

    Never mind, I see now that FND_REQUEST.SUBMIT_REQUEST() really does work, I tried with a different standard java concurrent program and it worked fine, and then I figured out that my parameters into fnd_request.submit_request for concurrent program APXVVCF4 were not correct (application short name was invalid for concurrent program).
    Thanks for the Info!

  • Java Not Working, And Still No Answers. What Gives?

    Okay, decided to start this topic anew, since the only response I got to the other one was a post calling me "rude and impatient" (I guess that's what they're calling "persistence" nowadays..) , instead of...well...ignoring my admittedly pushy and harsh tone and actually being helpful. However, for the sake of it, I do apologize for my attitude in my last topic.
    But I digress, let's start off on a new foot, eh? On to the problem that is STILL at hand(in other words, "patience" hasn't gotten me jack, not even a "we don't know yet"):
    So last night (10 PM January 20th), the Firefox Plugin Checker said that my Java version was outdated. I also got a pop-up saying that my current version of Java at the time (Java 7 update 10) had vulnerabilities. So to try and fix this, I went to the Java page and downloaded the update (Java 7 update 11).
    To check and see if my update was working, I went to Java's check page, as well as another page I use. And here I discovered a problem. I got a notification that an old version of Java had been detected, and another prompt to download the current version (which I had already done). So I erased all versions of Java from my control panel, and tried to check it again. And when I did, I got this: http://oi50.tinypic.com/35b6xx2.jpg and http://oi47.tinypic.com/15fg37p.jpg.
    As you can see, both pages tell me that I need to install a missing plugin of some sort. So, thinking this would resolve the issue, I clicked the Install Missing Plugin button. This is what it told me was missing: http://oi45.tinypic.com/302uwbl.jpg. So I clicked next to install it.... and got this: http://oi45.tinypic.com/2cici0x.jpg, which I assume means that the plugin did not install. So I pressed Manual Install... and was lead/linked right back to the Java download page (where it all began, and what doesn't seem to be working in the first place)
    I go to check my plugins again (Just to make sure and also for extra information), and it appears to say that my Java version is current (is that what "Java Deployment Toolkit 7.0.110.21" is? I don't know, I am not good at technology at all. Either way, here is what it looks like: http://oi48.tinypic.com/4kxzz4.jpg). So...if it is current, why is it not working (i.e. I am unable to play games, DO MY COLLEGE CLASSWORK, or play Java-based games)?
    If it helps anything, here is what my control panel looks like in regards to Java right now: http://oi45.tinypic.com/2qlxu9t.jpg Am I missing anything that would make Java work?
    And before anyone says that Java is not essential: It may be that way to you, but I need Java to do classwork for college. Veterinary college.
    So, in short, what is going on with Java, and how can I fix it?
    EDITEDITEDIT: I Have found that I can do my classwork without Java. HOWEVER, this DOES NOT mean that the problem is solved or over with. I STILL WANT TO KNOW HOW TO FIX THIS PROBLEM AND GET JAVA TO WORK. Even if I never actually need it, I would still like to have a (working!!!) Java version because of two reasons: 1) I would rather have such a program and not need it, than need such a program and not have it, and 2) aesthetics. Sorry to say, but I am very particular about how things look when it comes to my belongings, and the fact that Java is messing up is making me actually stressed. In short, I still want the above issue solved, even if it's just purely for the sake of Peace Of Mind.
    Another note: I would (please!) appreciate a timely response on this matter. Even if the response is a "We don't know what the issue is and/or we are working to solve this issue.", that would satisfy me for the time being. I would just like a semi-timely response that would let me know that FF/contributors here have read the above and actually give a semblance of a care about their userbase.
    Thank You.

    '''ponyparty, '''
    The first prompt you see in Firefox to activate Java is because Java is currently on the Mozilla blocklist ( the "Hot Topic" article [[How to use Java if it's been blocked]] explains the reason for block and how to activate Java, including how to bypass the plugin activation prompt for trusted sites).
    cor-el is right about why you are seeing a second [http://oi48.tinypic.com/de8f8y.jpg Java "Security Warning"] when trying to view Java applets, that you have to click to run. This is a ''' Java''' security feature and not anything Firefox does.
    Try the same Java sites in Internet Explorer .... don't you also see the Java "Security Warning?" If you want to lower your Java security back to "Medium" in the Java Control Panel, see http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/jcp.html#security for details. That's up to you but I would leave it on "High " since Java 7 is still basically insecure, according to the reports I've seen and [https://blog.mozilla.org/security/2013/01/11/protecting-users-against-java-vulnerability/ this "Protecting Users Against Java Vulnerability]" Mozilla blog post.
    If the second Java prompt is your only remaining issue then your problem is really solved, since it is a new Java security feature and not anything in Firefox.
    Some background:<br>
    At the time I was helping you in the [https://support.mozilla.org/en-US/questions/944267 older thread you started] (now locked because you started this one) the solution to uninstall JavaFX wasn't known. On Dec 13th I wrote, ''There may be problems with Java 7 Update 10 since a number of Windows users have reported that Firefox is not detecting the plugin'' and I linked to a couple of related threads, including [http://forums.mozillazine.org/viewtopic.php?f=38&t=2628935 this MozillaZine thread], in which uninstalling JavaFX as a solution was posted 22 Dec 2012. On 25 Dec 2012 in the same MozillaZine thread, I posted a link to [https://bugzilla.mozilla.org/show_bug.cgi?id=820759#c12 this Dec 24th bugzilla comment] by an Oracle employee, who posted that uninstalling JavaFX was a solution for '''Oracle's''' Java 7 detection bug. Oracle has been working on the bug (to be fixed in an upcoming Java 7 release) and they created [https://www.java.com/en/download/help/firefox_java.xml this java.com help page], which is now included in the related MozillaZine and Mozilla Support articles on Java that I posted above.

  • Can someone pls help me with java on my macbook pro because after i download the mountain lion java has died and i need java to see streaming quotes from stock market

    can someone pls help me with java on my macbook pro because after i download the mountain lion java has died and i need java to see streaming quotes from stock market

    Java is no longer included in Mac OS X by default. If you want Java, you will have to install it.
    However, note that you should think twice before installing Java for such a trivial need as looking at stock market quotes. There are other ways to get that information that don't involve Java, and using Java in your web browser is a HUGE security risk right now. Java has been vulnerable to attack almost constantly for the last year, and has become a very popular, frequently used method for getting malware installed via "drive-by downloads." You really, truly don't want to be using it. See:
    Java is vulnerable… Again?!
    http://java-0day.com

  • Mac OS 10.4.8 , Java Web Start and JRE version of 1.4.2 and 1.5.0 problem

    Hello,
    I've been searching internet and reading the problems related to Java Web Start and JNLP.
    But no solution I read can solve what I faced.
    I'm running Mac OS x 10.4.8 and Macintosh updates the Java in my machine so that it has Java version 1.4.2 and Java 1.5.0
    The application I'm running needs to be running in JRE 1.4.2.
    So I changed the Java Preferences so that the default Java setting is JRE 1.4.2. However, the JNLP application still running in Java 1.5.0
    So I changed the MIME and make sure the JNLP is opened with Java Web start instead. The Java Web start is for version 1.4.2. I also change its preference so that the console is opened.
    I tried to run the JNLP application once again. Java web start 1.4.2_09 starts and console open, but the Java Runtime is still showing Java 1.5.0
    I adjust the JNLP file so that the version is only showing 1.4.2_09 (ignoring all other variables of version 1.4.1, 1.4.2, etc found in the original JNLP file). That didn't work either.
    I search on methods on how to uninstall Java 1.5.0 in Mac - apple page told me that I can't do that unless I reinstall the whole OS.
    I am henceforth declare that I am stuck now !!!! Heellllpp....

    Are you up to date with the updates?
    Update for Snow Leopard users:
    Apple issued update 12 for Java for OS 10.6:
    http://support.apple.com/kb/DL1573
    Note:  On systems that have not already installed Java for Mac OS X 10.6 update 9 or later, this update will configure web browsers to not automatically run Java applets. Java applets may be re-enabled by clicking the region labeled "Inactive plug-in" on a web page. If no applets have been run for an extended period of time, the Java web plug-in will deactivate.
    If, after installing Java for OS X 2013-002 and the latest version of Java 7 from Oracle, you want to disable Java 7 and re-enable the Apple-provided Java SE 6 web plug-in and Web Start functionality, follow these steps:
    http://support.apple.com/kb/HT5559?viewlocale=en_US
    Further update:
    Apple issued this Java related security update No. 13 on February 19:
    http://support.apple.com/kb/HT5666
    and Update No. 14 on March 4:  http://support.apple.com/kb/DL1573
    http://support.apple.com/kb/HT5677
    The standard recommendation is for users to turn off Java except when they have to use it on known and trusted websites (like their bank). Javascript, which is unrelated despite the name, can be left on.

  • Java Web Start and DeployDirector: What's the difference?

    I am the product manager for DeployDirector at Sitraka (now part of Quest Software). I'm NOT in sales; I'd simply like to provide you with some information.
    From talking with DeployDirector users and evaluators, and from my own discussions with the folks at Sun, I have discovered that there is great deal of confusion about the difference between Java Web Start and DeployDirector. I'd like to clarify this by periodically posting some information about the two.
    Though the products seem similar in concept, they are designed for different purposes. They both deploy, auto-update and manage the JRE for client-side Java applications, but beyond that, they are quite different.
    Java Web Start is ideally designed for applications deployed over the Internet, where application-provider trust is an issue. Why? The security sandbox guarantees that application can do no harm. (There's some good information about Java Web Start and sandbox apps on ScheduleWorld at http://www.scheduleworld.com/itsYourLife.html) Web Start's architecture simply consists of a client piece that interprets a JNLP file. Because of the sandbox and its simplicity, I believe JWS is best used for independent software vendors, independent developers, etc.
    Because DeployDirector is ideally designed for internal enterprise applications, it does not enforce the security sandbox. Trust is not an issue here, because internal users typically trust their internal IT group. DeployDirector's architecture consists of both a client and a server piece, which allows us to support more complex deployment and update scenarios (e.g., scheduled and optional updates) and applications management capabilities like rollback, reporting, exception monitoring, authentication/authorization out of the box. All of this is configured through the DeployDirector administration console.
    In some situations, DeployDirector may be unnecessary overhead. In other situations, Java Web Start simply does not provide enough capability and building in this into Web Start can be difficult.
    If you'd like more information, we have whitepapers and case studies (including one specifically about DeployDirector and JWS) available on our website at http://www.sitraka.com/software/deploydirector/
    If you'd like to discuss some of these differences, or if you have questions about DeployDirector, feel free to email me directly. (Or post here, of course.)
    Thanks,
    Sonal Champsee
    [email protected]

    Hi Gerald,
    Given what I know about your emnity towards DeployDirector (which is clearly illustrated in this thread: http://forum.java.sun.com/thread.jsp?thread=348061&forum=38&message=1446155 that was evidently a response to this article: http://www.javaworld.com/javaworld/jw-11-2002/jw-1122-autoupdate.html) I'm going to take a (pardon the expression) "don't feed the trolls" approach here.
    I'm simply re-iterate that JNLP, and its implementations such as Web Start and OpenJNLP, are designed for a very different set of users that DeployDirector. The differences in functionality between the two products reflect that.
    The enterprise has different requirements in a deployment mechanism for its internal, critical applications than software vendors and independant developers. DeployDirector addresses the requirements of the enterprise. Frankly, most of our recent customers only chose to buy the product after initially rejecting it and (unsucessfully) attempting to use JNLP and Web Start. Sometimes people only learn the hard way: different users have different requirements which are suited to different tools or technologies.
    Sonal

  • Why java file name and class name are equal

    could u explain why java file name and class name are equal in java

    The relevant section of the JLS (?7.6):
    When packages are stored in a file system (?7.2.1), the host system may choose to enforce the restriction that it is a compile-time error if a type is not found in a file under a name composed of the type name plus an extension (such as .java or .jav) if either of the following is true:
    * The type is referred to by code in other compilation units of the package in which the type is declared.
    * The type is declared public (and therefore is potentially accessible from code in other packages).
    This restriction implies that there must be at most one such type per compilation unit. This restriction makes it easy for a compiler for the Java programming language or an implementation of the Java virtual machine to find a named class within a package; for example, the source code for a public type wet.sprocket.Toad would be found in a file Toad.java in the directory wet/sprocket, and the corresponding object code would be found in the file Toad.class in the same directory.
    When packages are stored in a database (?7.2.2), the host system must not impose such restrictions. In practice, many programmers choose to put each class or interface type in its own compilation unit, whether or not it is public or is referred to by code in other compilation units.

  • Give me description about JAVA Proxy Runtime and JAVA Proxy Server

    Give me description about JAVA Proxy Runtime and JAVA Proxy Server with some examples.

    Hi,
    Java proxy runtime :
    Using the Java proxy runtime you can receive messages or send messages to the Integration Server.
    This will help you
    http://help.sap.com/saphelp_nw04/helpdata/en/64/7e5e3c754e476ee10000000a11405a/frameset.htm
    Java proxy server :
    The connection to the Integration Server by using the Java proxy runtime.
    This will help you
    http://help.sap.com/saphelp_nw04/helpdata/en/87/5305adc23540b8ac7bce08dbe96bd5/frameset.htm
    Regards
    Agasthuri Doss

  • Java 6 uninstall and then install for MAC OS 10.5.8, how do I do it?

    I am using RefWorks and Write-N-Cite at school and am having trouble with them.  Refworks cust service said there is a corrupt java file in my computer and that I need to uninstall Java 6 from macbook OS 10.5.8 and reinstall.  How do I do this?  Does this sound right?

    If you need the Jave 6 JRE and plug-in, MadMAC0 has posted at
    https://discussions.apple.com/message/20107182?ac_cid=tw123456#20107182
    Apple has also posted (Oct 22/12) the approved solution for restoring the Java 6 plug-in:
    Java for OS X 2012-006: How to re-enable the Apple-provided Java SE 6 applet plug-in and Web Start functionality.

Maybe you are looking for

  • No longer any video visible, only green, pink and yellow blocks of color.

    I am using FCE 4.0 For some reason I no longer see any video in my Viewer window and my Canvas window. The video image is completely messed up All I see are seemingly random green, pink and yellow blocks of color. I do hear the audio the way it is su

  • Processing Mode = 'Delete'; Archive Faulty Source Files; Add Timestamp ?

    XI3.0 SPS 19 For FTP Sender adapter, if Processing Mode is Delete, and you want to Archive Faulty Source Files with an added timestamp, it does not work (meaning it does not archive the faulty source file at all). Any suggestions? If I change the pro

  • My phone thinks I am abroad. How can I get it to realise I am in the UK?

    Whenever I go to Orange World I get 'Welcome to your international page' and the option 'Costs while abroad' is highlighted. I try to select some other page such as 'All today's sport'  but it just reverts to 'Cost while abroad' and I can't get . I h

  • Obsecure Javascript error

    I've recently started getting a JS error on this page and I've not changed a thing. Can someone give me a hand in trying to clarify what it is? http://www.final-exodus.net/aboutme.php many thanks

  • Must tweak preferences on startup to get sound. Why?

    When I start up my Mac Pro I can't get any sound. First I must open the system preference and set the sound output preference. Then there is no problem getting sound until I next boot up the computer, when the same problem reoccurs. Is there a way to