Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 7th, 2012  |  syntax: None  |  size: 1.06 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Get the count value in android app from webservice
  2. PreparedStatement statement =  con.prepareStatement("select * from orders where status='Q' AND date = CURDATE()");
  3.  
  4.         ResultSet result = statement.executeQuery();
  5.  
  6.        while(result.next()){
  7.  
  8.    int count=0;
  9.    count++;
  10.   System.out.println(count);
  11.    }
  12.    }
  13.  
  14.    catch(Exception exc){
  15.      System.out.println(exc.getMessage());
  16.       }
  17.  
  18.     return customerInfo;
  19.     }
  20.        
  21. HttpTransportSE ht = new HttpTransportSE(URL);
  22.         try {
  23.         ht.call(SOAP_ACTION, envelope);
  24.         SoapPrimitive response = (SoapPrimitive)envelope.getResponse();
  25.         SoapPrimitive s = response;
  26.         String str = s.toString();
  27.         String resultArr[] = str.split("&");//Result string will split & store in an array
  28.  
  29.         TextView tv = new TextView(this);
  30.  
  31.         for(int i = 0; i<resultArr.length;i++){
  32.         tv.append(resultArr[i]+"nn");
  33.        }
  34.         setContentView(tv);
  35.  
  36.     } catch (Exception e) {
  37.         e.printStackTrace();
  38.     }
  39.        
  40. int count=0;    
  41. while(result.next()){
  42.    count++;
  43. }
  44. System.out.println(count);