Problem with String to Int conversion

Dear Friends,
Problem with String to Int conversion
I am having a column where most of the values are numeric. Only 4 values are non numeric.
I have replaces those non numeric values to numeric in order to maintain the data type.
CASE Grade.Grade  WHEN 'E4' THEN '24'  WHEN 'E3' THEN '23'  WHEN 'E2' THEN '22' WHEN 'E1' THEN '21' ELSE Grade.Grade  END
This comes the result as down
Grade
_0_
_1_
_10_
_11_
_12_
_13_
_14_
_15_
_16_
_17_
_18_
_19_
_2_
_20_
_21_
_22_
_23_
_24_
_3_
_4_
_5_
_6_
_7_
_8_
_9_
Refresh
Now I want to convert this value to numeric and do some calculation
So I changed the formula as below
cast (CASE Grade.Grade  WHEN 'E4' THEN '24'  WHEN 'E3' THEN '23'  WHEN 'E2' THEN '22' WHEN 'E1' THEN '21' ELSE Grade.Grade  END as INT)
Now I get the following error
View Display Error
_     Odbc driver returned an error (SQLExecDirectW)._
Error Details
Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
_State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17001] Oracle Error code: 1722, message: ORA-01722: invalid number at OCI call OCIStmtFetch. [nQSError: 17012] Bulk fetch failed. (HY000)_
SQL Issued: SELECT cast ( CASE Grade.Grade WHEN 'E4' THEN '24' WHEN 'E3' THEN '23' WHEN 'E2' THEN '22' WHEN 'E1' THEN '21' ELSE Grade.Grade END as Int) saw0 FROM "Human Capital - Manpower Costing" WHERE LENGTH(CASE Grade.Grade WHEN 'E1' THEN '20' WHEN 'E2' THEN '21' WHEN 'E3' THEN '22' WHEN 'E4' THEN '23' ELSE Grade.Grade END) > 0 ORDER BY saw_0_
Refresh
Could anybody help me
Regards
Mustafa
Edited by: Musnet on Jun 29, 2010 5:42 AM
Edited by: Musnet on Jun 29, 2010 6:48 AM

Dear Kart,
This give me another hint, Yes you are right. There was one row which returns neither blank nor any value.
I have done the code like following and it works fine
Thanks again for your support
Regards
Code: cast (CASE (CASE WHEN Length(Grade.Grade)=0 THEN '--' ELSE Grade.Grade END) WHEN 'E4' THEN '24' WHEN 'E3' THEN '23' WHEN 'E2' THEN '22' WHEN 'E1' THEN '21' when '--' then '-1' ELSE Grade.Grade END as Int)

Similar Messages

  • Problem with String variable

    I am new to Java Programming.
    I have a line of code that works and does what is supposed to.
    faceData.getProfile("Lisa").removeFriend("Curtis");
    If I assign the strings to variables such as-
    String name = "Lisa";
    String fName = "Curtis";
    and then plug those into the same line of code, it does not work
    faceData.getProfile(name).removeFriend(fName);
    What could be causing the problem?
    I even added some lines to print out what is stored in the variables to verify that they are what they should be, but for some reason the variables do not work while putting the strings in quotes does. Any ideas?

    I guarantee that something about your assertions are incorrect. Those variables are either not equal to the values you claim, or something else is going on. But it's not a problem with string variables versus string constants.
    Edit: My best guess in lack of a real example from you, is that the strings in question have non-printable characters in them, such as trailing spaces or line feeds.

  • Little problem with Strings.

              I have an little problem with Strings, i make one comparision like this.
              String nombre="Javier";
              if( nombre.equalsIgnoreCase(output.getStringValue("CN_NOMBRESf",null)) )
              Wich output.getStringValue("CN_NOMBRESf",null) is "Javier" too, because I display
              this before and are equals.
              What I do wrong?.
              

    You are actually making your users key in things like
    "\026"? Not very user-friendly, I would say. But
    assuming that is the best way for you to get your
    input, or if it's just you doing the input, the way to
    change that 4-character string into the single
    character that Java represents by '\026', you would
    use a bit of code like this:char encoded =
    (char)Integer.parseInt(substring(inputString, 1),
    16);
    DrClap has the right idea, except '\026' is octal, not hex. So change the radix from 16 to 8. Unicode is usually represented like '\u002A'. So it looks like you want:String s = "\\077";
    System.out.println((char)Integer.parseInt(s.substring(1), 8));Now all you have to do is parse through the String and replace them, which I think shouldn't be too hard for you now :)

  • I have proubleam with string to date conversion, i out put date fromat is 2012-04-30T23:48:55.727-07:00 . so please help me the format conversion

    i have proubleam with string to date conversion, i out put date fromat is 2012-04-30T23:48:55.727-07:00 . so please help me the format conversion.
    i wrote the method but it not workig
    My method is
    -(NSDate *)dateformstr:(NSString *)str
    NSString *date = [str stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
        NSDateFormatter *dateFormate = [[NSDateFormatter alloc] init];
      [dateFormate setDateFormat:@"yyyy-MM-dd'T'HH:mm:sssZZZZ"]
    // NSDate *formatterDate = [dateFormate  dateFromString:str];
        return formatterDate;
    but i did not the value and if i try othere formate i is working but my requiremet format is 2012-04-30T23:48:55.727-07:00.
    can any help it out in this senario.

    Sorry Butterbean, but I'm interested in the answer to your question myself.
    I've spent a few hours transfering my library from one computer to another and then find out that my ratings didn't transfer. Like you, I've spent many hours rating my 2000+ songs. I'm sure you have more, nevertheless, I want to find out how to get those ratings. They still show in my iTunes on my laptop but, when I go to the iTunes folder and display the details of at song, no rating is there. If you find out how to get them to display there in the iTunes folder, it seems that would be the key.
    Hope you get your answer soon.

  • Problems with string tokenizer

    okay heres my problem, i have a textarea displaying a program listing and i have to extract variables i.e public int something;
    i have tried many different approaches but still the output is not what i was looking for. Can someone have a look at my code and check for mistakes that i cant find
    public void createDataDictionary() {
              if(fullText.equals("")) return;//do nothing if no text exists
              String checkText = fileContents.getText();//store text area contents into string
              String dataType = "";
              String variable = "";
              String accessModifier = "";
              StringTokenizer str = new StringTokenizer(checkText," \n", true);
              fileCheckBox.setText("");//clear file check box
              while(str.hasMoreTokens()) {//loop while there are more tokens to tokenize
                   try{                    
                        checkText = str.nextToken();
                        //check for comments
                        if((checkText.startsWith("//")) || (checkText.equals("//")) ||
                           (checkText.startsWith("/**")) || (checkText.equals("/**")) ||
                           (checkText.startsWith("*")) || (checkText.equals("*"))) {
                             isComment = true;                    
                        if((checkText.equals("\n"))) isComment = false;
                        if(!isComment)
                             //check for access modifiers
                             if((checkText.equals("public")) || (checkText.equals("private")) ||
                                (checkText.equals("protected"))) {
                                          accessModifier = checkText;
                                     }else {
                                          accessModifier = "";
                             //check for data types             
                             if((checkText.equals("boolean")) || (checkText.equals("char")) ||
                                     (checkText.startsWith("String")) || (checkText.equals("int"))) {
                                       dataType = checkText;
                                       variable = str.nextToken();//get variable expression
                                       System.out.println(accessModifier + " " + dataType + " " + variable);
                   }catch(NoSuchElementException nsee) {//not enough tokens to complete operation
                        JOptionPane.showMessageDialog(null, "End of file");
                        return;//break from method
         }here is sample text
    private String seven = "help";
    char five[];
    // String here
    //int found
    public boolean okay
    and here is the output
    String
    char
    String
    boolean
    //note the space before each output
    hope someone can help
    thanx in advance

    1. Why do you check to see if the token starts with
    //, /*, etc, etc. Later you check if the token
    equals private, public, protected. It couldn't
    equal if it started with a comment.if the token starts with a comment i dont want to read the rest of the line, so i set the isComment flag to true
    2. I strongly suggest that you do it line by line.
    Perhaps a string tokenizer that only tokenizes by
    lines, then within that loop, another that tokenizes
    by whitespace. i take it you mean putting the text into a bufferedreader and then using readLine()?? Bit new to string tokenization as you can possibly see
    i managed to get the small test text to work more or less as i wanted but when ever i load a large code listing, the results are erratic to say the least
    heres a section of this code
    private int textNum = 0;/**Integer used to hold the text position within any given line*/
         private int lineNum = 0;/**Integer used to hold the line number within any given file*/
         static boolean application = false;/**Used to track if applet is ran from a browser or JAR file*/
         static boolean fileOpened = false;/**Used to track if file has already been opened*/
         static boolean isComment = false;
         private char lCurve = '(';
         private char rCurve = ')';
         private char lCurly = '{';
         private char rCurly = '}';
         private char lSquare = '[';
         private char rSquare = ']';
         String fullText = "";and heres the output
    public int textNum //should be private!!!!
    int lineNum //missing private
    boolean application //missing static
    boolean fileOpened //missing static
    boolean isComment //missing static
    //all below missing private     
    char lCurve
    char rCurve
    char lCurly
    char rCurly
    char lSquare
    char rSquare
    String fullText //not there at all

  • Problem with String in a Vector

    I'm making a small hangman game. And I got a problem with putting words in a Vector... This is the code... Can someone tell me what I'm doing wrong?
    // First I define it.
    Vector Words;
    //  Then add the words
    Vector Words = new Vector();
    Words.add(new String("HELLO"));
    Words.add(new String("GOOD BYE"));
    // When I try to get a string from the Vector I use this.
    // The program compiles but when I try to run it I get NullPointerExeption here
    W = (String) Words.elementAt(0);

    Not sure since I cant see all of your code but looks like this might be your problem:
    // First I define it.
    Vector Words; //<-- here you define a Vector named Words that is null
    // Then add the words
    Vector Words = new Vector(); //<-- here you define another vector named Words that holds a reference to a new Vector. This is a different reference than the one created above so you should probably remove the "Vector" part from the beginning of this line. Is this a local variable to a method and the one before is a global variable?
    //Here you probably access the locally created Words vector which is initialized
    Words.add(new String("HELLO"));
    // When I try to get a string from the Vector I use this.
    // The program compiles but when I try to run it I get NullPointerExeption here
    W = (String) Words.elementAt(0); //<--and here my guess is that this statement is inside another method than the one with the local Words vector defined. Thus this one accesses the global Words Vector that is never initalized and is Null. And that gives you the NullPointerException.
    So try changing the statement
    Vector Words = new Vector();
    to
    Words = new Vector();
    or just remove it totally and move the Vector creation to the place where you introduce the global variable.
    Of course I might be totally wrong since I cant see all of your code but that is my guess.
    Hope it helps,
    -teka

  • String to int conversion

    can n e body tell me how can i convert a String to an int

    always remember to use the try/catch block with thins that throw exceptions
    String gg;
    int in;
    try{  
    gg = "30";
       in = Integer.parseInt(gg);
    catch(NumberFormatException e){ 
      e.printStackTrace();
    }Ant

  • How to read a C structure with string and int with a java server using sock

    I ve made a C agent returning some information and I want to get them with my java server. I ve settled communication with connected socket but I m only able to read strings.
    I want to know how can I read strings and int with the same stream because they are sent at the same time:
    C pgm sent structure :
    char* chaine1;
    char* chaine2;
    int nb1;
    int nb2;
    I want to read this with my java stream I know readline methode to get the first two string but after two readline how should I do to get the two int values ?
    Any idea would be a good help...
    thanks.
    Nicolas (France)

    Does the server sent the ints in little endian or big endian format?
    The class java.io.DataInputStream (with the method readInt()) can be used to read ints as binary from the stream - see if you can use it.

  • StringTokenizer class problem with strings in double quotes

    Hello Technocrats,
    I have a problem with tokenizing following string enclosed in (). (abc," India, Asia", computer engineer). My separator is ",", thus StringTokenizer class gives me 4 tokens namely abc, "India, Asia" and computer engineer. But I require that String in double quotes should be a single token. How to achieve this using StringTokenizer class? Or is there any other way?
    Thanks in advance.

    Try
    String[] str="abc,\" India, Asia\",computer engineer".split(",",1);
              for(String s: str)
                   System.out.println(s);
              }Thanks.

  • CC compiler problem with string.h

    Hi,
    I use Sun Studio Express (3-Dec-2006 Build) on SUSE Linux 10.1.
    When I was trying to compile the following code, I got an error message regarding <string.h>. The same codes works fine with g++ compiler.
    Please give me some comments on that.
    Thanks.
    Tae-Suk Bae
    #include <stdio.h>
    #include <string.h>
    int main(int argc, char**argv) {
    char str[80];
    strcpy(str,"Test");
    printf("%s\n",str);
    return 0;
    CC -c -g -o build/Debug/Sun-Linux-x86/welcome.o welcome.cc
    (/home/baezae/ngsode/Welcome1)welcome.cc:
    "/usr/include/string.h", line 272: Error: End of file encountered in macro arguments for "__nonnull".
    "/usr/include/string.h", line 272: Error: ")" expected instead of "(".
    "/usr/include/string.h", line 272: Error: Unexpected ")" -- Check for matching parenthesis.
    "/usr/include/string.h", line 272: Error: Operand expected instead of ";".
    "/usr/include/string.h", line 426: Error: "strerror_r(int, char*, unsigned)" is expected to return a value.
    "welcome.cc", line 30: Error: "}" expected instead of "end of file".
    6 Error(s) detected.
    ----------------------------------------------------------

    I have that feeling that this has been solved in later version, February build. It is available for download here: http://developers.sun.com/sunstudio/downloads/express.jsp
    Maybe compiler experts will be able to provide more accurate answer, though.

  • Problems with string arrays

    Previous task was:
    Write a class "QuestionAnalyser" which has a method "turnAnswerToScore". This method takes a String parameter and returns an int. The int returned depends upon the parameter:
    parameter score
    "A" 1
    "B" 2
    "C" 3
    other 0
    Alright, here's the recent task:
    Write another method "turnAnswersToScore". This method takes an array of Strings as a parameter, works out the numerical score for each array entry, and adds the scores up, returning the total.
    That's my code:
    class QuestionAnalyser{
    public static int Score;
    public String[] Answer;
    public static void main(String[] args) {}
         public int turnAnswerToScore(String[] Answer)
    for (int i = 0; i < Answer.length;i++) {
    if (Answer.equals("A")) {
    Score = Score + 1; }
    else if (Answer[i].equals("B")) {
    Score = Score + 2;}
    else if (Answer[i].equals("C")) {
    Score = Score + 3;}
    else {
    Score = Score + 0;}
    return Score;
    this is the error message I get:
    The results of trying to compile your submission and run it against a set of test data was as follows:
    ----------Compilation output--------------------------------------
    javac QATest2.java
    QATest2.java:15: cannot resolve symbol
    symbol : method turnAnswersToScore (java.lang.String[])
    location: class QuestionAnalyser
    if(qa.turnAnswersToScore(task)!=total){
    ^
    What went wrong?
    Suggestions would be greatly appreciated!

    If I declare int score in the method i get this message
    The results of trying to compile your submission and run it against a set of test data was as follows:
    ----------Compilation output--------------------------------------
    javac QATest2.java
    ./QuestionAnalyser.java:20: variable score might not have been initialized
    score++; }
    ^
    ./QuestionAnalyser.java:23: variable score might not have been initialized
    score++;
    ^
    ./QuestionAnalyser.java:27: variable score might not have been initialized
    score++;
    ^
    ./QuestionAnalyser.java:34: variable score might not have been initialized
    return score;
    ^
    4 errors
    ----------Sorry expected answer was-------------------------------
    The method turnAnswersToScore is working OK - well done!
    ----------Your answer however was---------------------------------
    Exception in thread "main" java.lang.NoClassDefFoundError: QuestionAnalyser
         at QATest2.main(QATest2.java:4)
    This is the message I get from the submission page, but trying to compile it I get the same messages.
    The code looks like this, then
    class QuestionAnalyser{
    String[] answer;
    public static void main(String[] args) {}
         public int turnAnswersToScore(String[] answer)
    int score;
    for (int i = 0; i < answer.length; i++) {
    if (answer.equals("A")) {
    score++; }
    else if (answer[i].equals("B")) {
    score++;
    score++; }
    else if (answer[i].equals("C")) {
    score++;
    score++;
    score++; }
    else {}
    return score;
    When I leave 'public int score;' where it was before (right after the class declaration below the declaration of the string array) I get this but it compiles normally.
    The results of trying to compile your submission and run it against a set of test data was as follows:
    ----------Compilation output--------------------------------------
    javac QATest2.java
    ----------Sorry expected answer was-------------------------------
    The method turnAnswersToScore is working OK - well done!
    ----------Your answer however was---------------------------------
    wrong answer in turnAnswersToScore for
    BDCAADDCA
    Alright, even university students need to sleep :-)
    Good night.

  • BPC 7.5: problem with FX_SOURCE_CATEGORY on currency conversion

    Hi,
    we are trying to convert our actual data with two different rates. For this we have created two categories, ACTUAL and ACTUAL_PY.
    ACTUAL has blank FX_SOURCE_CATEGORY and blank RATE_CATEGORY properties and the conversion works fine.
    ACTUAL_PY has FX_SOUCE_CATEGORY of ACTUAL and RATE_CATEGORY of either blank or ACTUAL_PY (we have tested with both).
    The conversion of ACTUAL_PY when run for the first time correctly converts all accounts/flows that have a conversion method of AS_IS corectly. When run for the second time, it doubles up to amounts on those AS_IS accounts/flows. When run for the third time, the amounts are tripled etc.
    Can anyone point me in the right direction of how FX_SOURCE_CATEGORY should work?
    Thanks,
    Arnold
    Edited by: ArnoldWarhonowicz on Sep 30, 2011 10:35 AM
    Edited by: ArnoldWarhonowicz on Sep 30, 2011 10:53 AM

    Hi,
    we are trying to convert our actual data with two different rates. For this we have created two categories, ACTUAL and ACTUAL_PY.
    ACTUAL has blank FX_SOURCE_CATEGORY and blank RATE_CATEGORY properties and the conversion works fine.
    ACTUAL_PY has FX_SOUCE_CATEGORY of ACTUAL and RATE_CATEGORY of either blank or ACTUAL_PY (we have tested with both).
    The conversion of ACTUAL_PY when run for the first time correctly converts all accounts/flows that have a conversion method of AS_IS corectly. When run for the second time, it doubles up to amounts on those AS_IS accounts/flows. When run for the third time, the amounts are tripled etc.
    Can anyone point me in the right direction of how FX_SOURCE_CATEGORY should work?
    Thanks,
    Arnold
    Edited by: ArnoldWarhonowicz on Sep 30, 2011 10:35 AM
    Edited by: ArnoldWarhonowicz on Sep 30, 2011 10:53 AM

  • Problems with string encoding - need the text content in char* format.

    The problem is non ASCII-characters, which comes out as some sort of unicode I need to desipher.
    Here's what I got:
    A text frame object with the TextString "Agnartjørna"
    I get the text content of this object into an ai::UnicodeString the following way:
    AIErr
    VMGetTextOfTextArt( AIArtHandle textArt, ai::UnicodeString &ucStr)
        ASUnicode *textBuffer = NULL;
        AITRY {
            TextFrameRef ateTextRef;
            AIX( sAITextFrame->GetATETextFrame( textArt, &ateTextRef));
            ATE::ITextFrame ateText( ateTextRef);
            ATE::ITextRange ateRange = ateText.GetTextRange( true);
            ASInt32 textLen = ateRange.GetSize();
            AIX( sSPBlocks->AllocateBlock( (textLen+2) * sizeof( ASUnicode), nil, (void**) &textBuffer));
            ateRange.GetContents( textBuffer, (ASInt32) textLen+1);
            /* trim off trailing newlines */
            if ((textBuffer[textLen] == '\n') || (textBuffer[textLen] == '\r'))
                 textBuffer[textLen] = 0;
            ucStr.clear();
            ucStr.append( ai::UnicodeString( textBuffer, textLen));
            sSPBlocks->FreeBlock( textBuffer);
            textBuffer = NULL;
           AIRETURN;
        AICATCH {
            if (textBuffer) sSPBlocks->FreeBlock( textBuffer);
           AIPROPAGATE;
    Now, the next step is to convert it into a form that I can use to call regexp.
    Baiscally, I want to detect the ending "tjørna" (meaning small lake) on a map label, and apply a standard abbevriation "tj^a" (with "a" superscripted).
    So the problem is to obtain the regexp pattern and the text content in same encoding.  And since the regexp library is old *char based, I would like to convert the text content in to plain old *char.
    Hence the following code:
    static AIErr
    VMAbbreviateTextArt( AIArtHandle textArt,
                             vmTextAbbrevEffectParams *params)
        AITRY {
        /* first obtain the text contents of the textArt */
           ai::UnicodeString ucText;
          const int kTextLen = 256;
          char textContent[kTextLen];
          AIX( VMGetTextOfTextArt( textArt, ucText));
          ucText.as_Roman( textContent, kTextLen);
    But textContent now has the value "Agnartj\xbfnna"  (According to XCode),
    which will not get a match on the pattern "tj([øe][rn])na\\" (with  backslash matching the end of the string)
    Any other ways to convert the textContent to a plain *char string?

    Thank you very much, your method will work fine. with
    the "UTF-8" parameter the byte[].length is double,
    cause every valid byte is preceeded by an -62, but I
    will just filter the valid bytes into a new array.
    Thanks again,
    StefanActually what you need to do is to find the character encoding that your device expects, and then you can code your strings in Arabic.
    That's the way Java does things; Strings and char values are always in UNICODE (see www.unicode.org) (which means \u600 to \u6ff for arabic) and uses a specified character encoding when translating these to and from a byte stream.
    Each national character encoding has a name. Most of them are identical to ASCII for 0-127 and code their national characters in 128-255.
    Find the encoding name for your display and, odds are, the JRE has it in the library.
    BTW the character encoding ISO-8859-1 simply maps UNICODE characters 0-255 on to bytes.

  • Problems with String[] Class Object

    Hi guys,
    I'm writing a web server who should invoke a method of a class when asked by a client.
    My problem is that if the method that should be invoked has a String[] parameter the web server is unable to invoke it and throws a java.lang.IllegalArgumentException: argument type mismatch.
    Useful pieces of code to understand are the following:
    //create the Class[] to pass as parameter to the getMethod method
    Class[] paramType = {String[].class};
    //find the class "className" and create a new instance
    Class c = Class.forName(className);
    Object obj = c.newInstance();
    //the getMethod should find in the class c the method called nameMeth
    // having paramType (i.e. String[]) as parameter type...
    Method theMethod = c.getMethod(nameMeth, paramType);
    //here's the problematic call!!
    theMethod.invoke(obj, params);I've noted that System.out.println(theMethod); prints the signature of the method with the parameter type java.lang.String[].
    System.out.println(paramType[0]); instead prints [Ljava.lang.String;
    I know that [L means that it is an array, so why do you think that I'm having an argument type mismatch?
    Thank you                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    I had no problems making that work.import java.lang.reflect.Method;
    public final class StringArray {
        public static final String CLASSNAME = "StringArray";
        public static final String METHODNAME = "myMethod";
        public static final String[] sa = { "a", "b"};
        // automatic no-args constructor
        public final void myMethod(String[] sa) {
            for(int i=0;i<sa.length;++i) {
                System.out.println(sa);
    public static final void main(String[] arg) throws Exception {
    //create the Class[] to pass as parameter to the getMethod method
    Object[] params = { sa };
    Class[] paramType = {sa.getClass()};
    //find the class "className" and create a new instance
    Class c = Class.forName(CLASSNAME);
    Object obj = c.newInstance();
    //the getMethod should find in the class c the method called nameMeth
    // having paramType (i.e. String[]) as parameter type...
    Method theMethod = c.getMethod(METHODNAME, paramType);
    //here's the problematic call!!
    theMethod.invoke(obj, params);

  • Problem with String in JSP! Help Me

    Hi all,
    i spent my whole day with this error. How can i solve it. I am trying to convert a string array to Integer array. The program is taking all the select input from the previous JSP page and then converting them into integer array for storing to database. i am catching them as request.getParameterValues(); but i found out that if i select 4 item from the menu it is storing in 8 array cells and the format is if you select 1 2 3 4 the it stores [1 null 2 null 3 null 4 null] i guessed that those are null values. so i have tried to select only 1 2 3 4 from the array and it is showing number format error on tomcat. here is the code guys. Please i am tired of it please help me. Thanks. SORRY I TRIED TO SEPARATE THE CODE BUT IT SEEMS LIKE THERE ARE SOME PROBLEM IN THE FORUM SETTINGS. so the code is:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <%@page import="java.io.*"%>
    <%@page import="java.sql.*"%>
    <%@page import="java.lang.String.*"%>
    <%@page import="java.lang.Character.*"%>
    <%@page import="java.util.*"%>
    <%@page import="java.text.*"%>
    <HTML>
    <HEAD>
    <TITLE> HR ADVANTAGE TIMESHEET </TITLE>
    </HEAD>
    <BODY>
    <%
    String emplno = request.getParameter("emplno");
    String date = request.getParameter("date");
    String proposal = request.getParameter("proposals");
    String network1 = request.getParameter("network");
    String suppassociates = request.getParameter("suppasso");
    String intmngt = request.getParameter("intmgt");
    String client[] = request.getParameterValues("client");
    String client1= request.getParameter("client1");
    String clientunit[] = request.getParameterValues("clientunit");
    String clientunit1=request.getParameter("clientunit1");
    boolean bool=true;
    int staffid = Integer.parseInt(emplno);
    int len=0;
    len=client.length;
    //String[] check_client = new String[len];
    //check_client=client;
    //int check_length=0;
    //check_length=check_client.length;
    //int unitlength=0;
    //unitlength=clientunit.length;
    int arr_length=0;
    arr_length=len-(len/2);
    int[] array = new int[arr_length];
    int j=0;
    j=arr_length;
    for (int i=0; i<len-1; i++)
    bool=true;
    if(client=="\0")
    bool=false;
         if(bool==true)
         array[arr_length-j]=Integer.parseInt(client[i]);
              j=j-1;
              if(j==0)
              break;
    %>
    </BODY>
    </HTML>
    The error is:
    org.apache.jasper.JasperException: For input string: ""
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:367)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:293)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    root cause
    java.lang.NumberFormatException: For input string: ""
         java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
         java.lang.Integer.parseInt(Integer.java:489)
         java.lang.Integer.parseInt(Integer.java:518)
         org.apache.jsp.store_jsp._jspService(store_jsp.java:107)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:320)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:293)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

    what are you trying to test with client [ i ] == "\0"
    You sure you dont need to test against null ?

Maybe you are looking for

  • Custom Administration Setting (Visual Studio form dll)

    I am developing a custom extension to SCSM that needs an administration settings page. I have the MP created and the SCSM part in place. Also the WPF User Control dll part, but the link between the two is the trouble. I have used Travis Wright's arti

  • Field Selection Is Overlayed By Personal Setting In ME21N

    Hello All, The scenario is this we have a purchase order type - that has unique settings which we don't want certain fields updated/entered. However, we are finding that users have personal settings that are still getting entered into the system desp

  • TS1347 I have a new iPad air and when I edit appointments in my calendar, and hit "done" the entire appointment disappears?

    I have a new iPad and having trouble with my calendar. When I edit an appointment made on my computer, and hot done....it just disappears? What am I doing wrong, please help?!

  • Serial not accepted

    MAC OS Mavericks. Just purchased PS Elements 12. Downloaded and tried to install. The serial number is not accepted. Could be a languages conflict? I use italian on my mac but PSE12 is english. Adobe customer service couldn't help.

  • Regarding short dump ASSERTION_FAILED

    Hi I tried to delete info object characteristcs from Info object from transaction RSA1. it gives short dump. pls advice how to avoid this. "ASSERTION_FAILED" " " "CL_RSAWBN_OBJ_IOBC_IOBJTREE===CP" or "CL_RSAWBN_OBJ_IOBC_IOBJTREE===CM002" "GET_IOBC" T