Can't parameter be passed in this way?

i wrote a method like this:
dis=new DataInputStream(socket.getInputStream());
byte[] inByte=new byte[20];
dis.read(inByte); //read "am" from client side
String inData=new String(inByte); //pass "am" to inData
     String outData=response(inData); //now inData is "am"
     System.out.println("outData= "+outData);
public String response(String inData) throws Exception {
          String outData=null;
          if(inData.equalsIgnoreCase("am"))outData="good morning";
          else outData="unknown";
          return outData;
at last i got "outData=unknown" ,why it's not "good morning"?

IN CLIENT SIDE:
String outData="am";          
DataOutputStream dos=new DataOutputStream(s.getOutputStream());               
byte[] outByte=outData.getBytes();
System.out.println(outByte); //OUTPUT : "[B@dc8569"  IS  WRONG  HERE ?
dos.write(outByte,0,outByte.length);  //pass "am" to server side
IN SERVER SIDE:
int num=dis.read(inByte);    //read from client side
System.out.println("num read : "+num); //OUTPUT:  2
String inData=new String(inByte);
System.out.println("inData: "+inData);//OUPUT:  "am" ,
                                                                   //so "am" is successfully passed to server                                                                                           
String outData=response(inData);     //so how strange this outData is!
System.out.println("outData: "+outData);//OUTPUT:  "unknown"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • TS4002 Once I send my email on icloud, it does not show up on my mail client or on icloud.  How can I retrieve an email sent this way?

    Once I send my email on icloud, it does not show up on my mail client or on icloud.  How can I retrieve an email sent this way?

    SADLY  not as i downloaded an upgrad to my original PAGES/
    i have in the meantim had to open www.icloud. then from there import the file that i am working on and then check on ipad if it uploaded/ yes it did.
    but what a waste of time as it doesn not save any changes done automatically back in the cloud....
    i am now downloading the new LION and hope that it will fix the problem
    i cant find any other way. I was lead to believe that you wrote, it saved automatically, on to the cloud, you then opened anohter device in anotother country even, and the new file was there, waiting, in its latest version.......
    and the same magic was supposed to happen in reverse.
    It doesn't/
    if i have to open a browser, go to www.icloud....why on earth did they not just leave us an icon to drop it in in that case?
    I hope the new lion will help resolve the isssue/
    any other ideas> keep em coming...thank you so much.

  • I have a graph with the x axis for volume and the y axis for mass, I need the data to correlate with the volume and mass, I can not simply label the axis this way, how can i do this?

    This is extremely urgent and please help!!!

    Do you mean something like this?
    If so, go to the Chart inspector. On the Axis tab of the Chart Inspector you can set the format for each axis. Choose "custom" then type in the units at the end of the format that is there.  You can't get fancy, like having superscripts or anything.
    Alternatively you can show the axis titles, also in the chart inspector:

  • Can't I call a function this way?

    I tried to get records from a table from server A (Sybase) and insert the records to server B (Oracle) using CF8
    Both has the same exact table and datatype
    When I do the following, I got this error and not sure where I did wrong
    Missing argument name.
    When using named parameters to a function, every parameter must have a name.The CFML compiler was processing:
    My codes:
    <cfquery name="getSybaseRec" datasource="DSN1">
      SELECT * FROM tbl_EP
    </cfquery>
    <CFLOOP query="getSybaserec">
        <CFSET ToOra ('#Column_1#', '#Column_2#', '#CreateODBCDate(DateColumn)#'>
    </CFLOOP>
    <CFFUNCTION name = "ToOra">
      <cfargument name="col1" type="String" required="True">
      <cfargument name="col2" type="String" required="True">
      <cfargument name="date_col" type="date" required="True">
      INSERT INTO tblEP_Ora (Column_1, Column_2, DateColumn)
       VALUES ('#arguments.col1#', '#arguments.col2#', #arguments.date_col#>
    </CFFUNCTION>

    Unless it is a copy paste error, you are missing close parenthesis ")" in the cfset and INSERT (as well as cfquery tags).

  • Can we call Tree Selection Listener this way..?

    Hi,
    I have written one class 'DemoTree' that implemets framework tree.In frame work tree
    We have All the listeners defined and all the listener methods have been implemented
    in 'DemoTree' class.
    Now I create one more class 'DemoTree2'.In this class I am instantiating 'DemoTree'.
    My question is.. is it possible to use listener method defined in 'DemoTree'.
    public class DemoTree implemets FrameWorkTree{
    public void selectionListener(event){
    public void mouseListener(event){
    public class DemoTree2 extend JPanel{
    private DemoTree  tree=new DemoTree();
    pubic void main(String arg[]){
    tree.selectionListener()-----> how to use/implement this feature?
    tree.mouseClicked()
    }Thanks.

    The real drivers are supplied to our OEMs by sending them an email conatining release notes for them in an encrypted Zip-file.
    They then need a password to FTP them from our FTP site.
    Any normal individual (i.e. end user) coming to ADI direct should gte a standard reply telling him to go to the Mobo manufacturer or PC supplier along with some links .
    Here is an example that I concocted as an MSWord autotext so I just type the word "sound" and this is inserted :
    Sound Cards and Modem Information
    Analog Devices does not manufacture sound or modem cards. Many sound cards use chipsets from Analog Devices in their designs.
    Drivers are often customized to work with specific PCs or motherboard platform. Please contact the manufacturer of the PC for technical assistance. For technical assistance on a specific sound card, please contact the manufacturer of the card. http://forms.analog.com/Form_Pages/soundMAX/soundMAXtechSupport.html
    may help.
    Other sources you can check:
    * You can visit the FCC's web site and use the search engine to see who manufactured the card.
    * You may also be able to locate & download drivers for these cards at the following web site: http://www.fcc.gov/oet/fccid/
    * You may want to try http://www.danworld.com/ for hotlinks to sound cards/modems
    * or   http://www.windrivers.com  .
    * http://www.driverguide.com  is extremely good  You have to register (once) but it is very useful and free. Copyright 1995- 2003 Analog Devices, Inc. All rights reserved.
    Chris Muriel, Manchester, UK  (ADI applications engineer).

  • I am former PC person. Could view folder content based on a picture of an item in the folder. Can folder in imac be viewed this way without opening the folder?

    New to Apple and imac. With a PC, I could view a folder's contents as 4 files from within would be viewable on the folder itself. With the imac, I cannot see what is in the folder without opening it first. Is this possible as that was very convenient.

    The following item in the App Store may be of interest to you.
    http://itunes.apple.com/us/app/iconstix/id412598996?mt=12

  • How to get each value from a parameter passed like this '(25,23,35,1)'

    Hi
    One of the parameter passed to the function is
    FUNCTION f_main_facility(pi_flag_codes VARCHAR2) return gc_result_set AS
    pi_flag_codes will be passed a value in this way '(25,23,35,1)'
    How to get each value from the string
    like 25 first time
    23 second time
    35 third time
    1 fourth time
    I need to build a select query with each value as shown below:-
    (SELECT t2.org_id, t4.description
    from org_name t2, ref_org_name t3, code_table t4
    where t2.att_data = t4.code
    and t3.ref_code = t2.att_type
    and t2.att_type = 25 and t3.code_type = t4.code_type
    and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date) q1,
    (SELECT t2.org_id, t4.description
    from org_name t2, ref_org_name t3,code_table t4
    where t2.att_data = t4.code
    and t3.ref_code = t2.att_type
    and t2.att_type = 23 and t3.code_type = t4.code_type
    and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date) q2,
    (SELECT t2.org_id, RTRIM(xmlagg(xmlelement(e, t4.description || ';')
    ORDER BY t4.description).EXTRACT('//text()'), ';') AS DESCRIPTION
    from org_name t2, ref_org_name t3,code_table t4
    where t2.att_data = t4.code
    and t3.ref_code = t2.att_type
    and t2.att_type = 35 and t3.code_type = t4.code_type
    and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date
    group by t2.org_id) q3,
    (SELECT t2.org_id, t4.description
    from org_name t2, ref_org_name t3, code_table t4
    where t2.att_data = t4.code
    and t3.ref_code = t2.att_type
    and t2.att_type = 1 and t3.code_type = t4.code_type
    and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date) q4
    Please help me with extracting each alue from the parm '(25,23,35,1)' for the above purpose. Thank You.

    chris227 wrote:
    I would propose the usage of regexp for readibiliy purposes and only in the case if this doesnt perform well, look at solutions using substr etc.
    select
    regexp_substr( '(25,23,35,1)', '\d+', 1, 1) s1
    ,regexp_substr( '(25,23,35,1)', '\d+', 1, 2) s2
    ,regexp_substr( '(25,23,35,1)', '\d+', 1, 3) s3
    ,regexp_substr( '(25,23,35,1)', '\d+', 1, 4) s4
    from dual 
    S1     S2     S3     S4
    "25"     "23"     "35"     "1"In pl/sql you do something like l_val:= regexp_substr( '(25,23,35,1)', '\d+', 1, 1);
    If t2.att_type is type of number you will do:
    t2.att_type= to_number(regexp_substr( '(25,23,35,1)', '\d+', 1, 1))Edited by: chris227 on 01.03.2013 08:00Sir,
    I am using oracle 10g.
    In the process of getting each number from the parm '(25,23,35,1)' , I also need the position of the number
    say 25 is at 1 position.
    23 is at 2
    35 is at 3
    1 is at 4.
    the reason I need that is when I build seperate select for each value, I need to add the query number at the end of the select query.
    Please see the code I wrote for it, But the select query is having error:-
    BEGIN
    IF(pi_flag_codes IS NOT NULL) THEN
    SELECT length(V_CNT) - length(replace(V_CNT,',','')) FROM+ ----> the compiler gives an error for this select query : PLS-00428:
    *(SELECT '(25,23,35,1)' V_CNT  FROM dual);*
    DBMS_OUTPUT.PUT_LINE(V_CNT);
    -- V_CNT := 3;
    FOR L_CNT IN 0..V_CNT LOOP
    if L_CNT=0 then
    V_S_POS:=1;
    V_E_POS:=instr(pi_flag_codes, ',', 1, 1)-1;
    else
    V_S_POS:=instr(pi_flag_codes,',',1,L_CNT)+1;
    V_E_POS:=instr(pi_flag_codes, ',', 1, L_CNT+1)-V_S_POS;
    end if;
    if L_CNT=V_CNT then
    V_ID:=TO_NUMBER(substr(pi_flag_codes,V_S_POS));
    else
    V_ID:=TO_NUMBER(substr(pi_flag_codes,V_S_POS,V_E_POS));
    end if;
    VN_ATYPE := ' t2.att_type = ' || V_ID;
    rec_count := rec_count +1;
    query_no := 'Q' || rec_count;
    Pls help me with fetching each value to build the where cond of the select query along with the query number.
    Thank You.

  • Why can't get the object "out" in this way?

    We use "PrintWriter out=response.getWriter()"to get a "out" object in Servlet and output text to webbrowser with it.But I think the PrintWriter is a class and Why can't I get the object "out" use this way:"PrintWriter out=new PrintWriter()"?I think the later is easier to understand.Anyone can help me?

    I check the Servlet API.The PrintWriter has a constructor with a abstract object Writer as it's parameter.I couldn't create the Writer object so I can't create the out object.Why it's constructor is protected by java?

  • Hi there. My iPod Nano was stolen from my car today. I do know the serial number of this stolen device. Is there any way that Apple can block another user from connecting this stolen device to iTunes?

    Hi there. My iPod Nano was stolen from my car today. I do know the serial number of this stolen device. Is there any way that Apple can block another user from connecting this stolen device to iTunes? Also, if another user was to attempt to connect this stolen device to iTunes, would Apple be able to inform of the username of this person in order that I could then pass this information to the police?

    Is there any way that Apple can block another user from connecting this stolen device to iTunes?
    No.
    Also, if another user was to attempt to connect this stolen device to iTunes, would Apple be able to inform of the username of this person in order that I could then pass this information to the police?
    No. Apple can do nothing to help. Sorry.
    Reporting a lost or stolen Apple product
    B-rock

  • I received the error (in iCal on my iMac): "The server responded with an error". The error message is very large, and if there is a way to acknowledge and close it I can't find it. Because this error message is open, I can't do anything in iCal. Any sugge

    I received the error (in iCal on my iMac): "The server responded with an error". The error message is very large, and if there is a way to acknowledge and close it I can't find it. Because this error message is open, I can't do anything in iCal. Any suggestions on how I could kill this error message? Thanks.
    iMac, Mac OS X (10.7.2)
    Basically i tried to enter too much information into my calendar and it has crashed  now i can not get rid of the error message or use the calendar  can anyone help please

    did you find ou how to get rid of it i can't

  • TS4002 I bought iPad and I can not access, A message appears asking me account and password when i return to the person who I purchased it from him, he told me that he forgot the account and password I want a solution to the problem, because in this way I

    I bought iPad and I can not access, A message appears asking me account and password when i return to the person who I purchased it from him, he told me that he forgot the account and password
    I want a solution to the problem, because in this way I will not benefit from the iPad

    There is no solution.  You have to provide the ID and password.  There is no way around it.  If the person you bought it from can't provide it, return it and get your money back.

  • How can I get the phone numbers in contacts to appear with dashes between the first 3 numbers, the next 3 numbers, and the last 4 numbers?  Until very recently it did so.  Contacts on my macbook pro does show up this way.  I do have a mobile me account an

    How can I get the phone numbers in contacts to appear with dashes between the first 3 numbers, the next 3 numbers, and the last 4 numbers?  Until very recently
    it did so.  Contacts on my macbook pro does show up this way.  I do have a mobile me account and in the past syncing was no problem.  What setting has changed?

    The phone number format as well as the date language and format and the time format are controlled by the Region Format setting. Go to Settings > General >International > Region Format.  When you change a region format, you can go back one page (to International) and see an example of the date/time/phone number format that your selected region format will produce.

  • TS1501 transferring a small batch of photos from the new ipad to macbook pro (this way you can upload one album at a time, file them into a new album on macbook pro)  Pls. advise.

    How can I transfer a small batch of photos from the new ipad to macbook pro?  In theory, I should be able to keep my albums together this way (once uploaded to macbook pro, i can easily file them into a new album on macbook pro.)  Not working for me!  Macbook pro does include iphoto.  I had no problem uploading ALL photos (3 or 4,000.)  Help!  Goal is to keep albums together.

    Hi all,
    Goal:  Backing up photos!
    Hope:  Transfer ALBUMS from ipad to external drive (via macbook pro)
    Is this possible?  Or will I have to create a file name for each of my thousands of photos?
    UGH!
    HELP!
    Lee

  • I have some problem with my computer because when i turn it up, the screen turns in a blue colour and the sound doesn't work and in this way i can't hear anything

    i have some problem with my computer because when i turn it up, the screen turns in a blue colour and the sound doesn't work and in this way i can't hear anything

    Will u help me or not?

  • How do I connect my 2nd generation Ipod to a Firewire 800 port? It no longer holds a charge and it doesn't power up with the newer generation USB cable. The only way I can sync my Itunes library onto this Ipod is when it is powered...

    How do I connect my 2nd generation Ipod to a Firewire 800 port on a new laptop? It no longer holds a charge and it doesn't power up with the newer generation USB cable. The only way I can sync my Itunes library onto this Ipod is when it is powered and connected simultaneously. Pls help.

    Try here:
    iOS: Not responding or does not turn on
    If not successful then time for an appointment at the Genius Bar of an Apple store.

Maybe you are looking for

  • Finder constantly crashes at startup and dock apps dont start

    So everything was running quite well yesterday when apart from running chrome, notes, and vuse, i tried to resumed my vmfusion session and then it suddenly disappeared and then the machine started beachballing which was followed by a finder crash whi

  • What is best Windows Virtual Machine?

    Hi I have a lot of stuff remained from my old Windows as some softwares without Mac couterpart or Word documents with ruined fonts which only can be seen on MS Word . I need a Virtual Machine with minimum performance reduction. I tried VMWare but it

  • How to return the entire row from a table

    Hi guys, Tabl A FirstName varchar2(10), Age Number, Add varchar2(100), Table B Filedname varchar2(200), -- contains all the fields of table A Datatype varchar2(100), -- Contains the datatypes of the filedname Length Number -- contains the length of t

  • How to remove scaling factor

    Hi, On our BCS transactional cube we have 3 kf - period value in group currency,  period value in local currency and period value in transaction currency. while I was exploring the measures (display data in the cube), I realized that the numbers were

  • Smartform - printout problem

    Dear Friends, I have developed smartform for KANBAN. Smartform containing color text and Background color shading. While testing with offshore printer, I can able to see the printout as per the preview. While testing the same in client end, I cannot