How to retrieve MqttService Binder

Hi guys!
I'm currently trying out MqttService and MqttServiceBinder from v1.0.2 of org.eclipse.paho.android.service. However, I am having trouble trying to retrieve the MqttService after binding my activity to the service.
I've tried to retrieve the service by first binding the service to the activity with bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
And later obtaining the service from the binder in onServiceConnected(ComponentName className, IBinder service) method in the ServiceConnection class. There's a public getService provided by MqttServiceBinder. However, the access level of the MqttServiceBinder class is now default, meaning that I cannot access it outside of its package, and thus am unable to cast the IBinder to MqttServiceBinder in my activity class.
I'm quite new to Android, so it will be great if anyone can explain to me how to obtain the MqttService to set the various attributes such as the client id for the MqttConnection.

Hi,
It sounds like you actually want the MqttAndroidClient.
Take a look at ClientConnections.java and AndroidManifest.xml from the sample app (http://git.eclipse.org/c/paho/org.eclipse.paho.mqtt.java.git/tree/org.eclipse.paho.android.service/org.eclipse.paho.android.service.sample).
The sample app should be a good starting point as it covers all of the basic MQTT service functionality.

Similar Messages

  • How to retrieve the result parameter ?

    Hello every body.
    We have selected the result parameter checkbox in a method created in a ZXXX bussiness object. We need to know how to retrieve this result from the task.
    Thank you in advance.
    Juan.

    Hi Juan,
    You can retrieve the result parameter from the method defining the Task.
    Just double click on the task number and you will be taken to the "Standard Task: Change" screen.
    Here Look out for a Small binding symbol in the Object Method cluster.
    Click on the binding symbol and do the necessary binding to get the result from the method to the Task containers.
    And subsequently, u can do the binding betweent the task containers and the workflow containers.
    Hope this helps.
    Regards,
    Raj

  • My safari menu bar is missing --the menu bar for desktop, HD, and apps appears, but when I click on Safari, it disappears, so I can no longer see my buttons for History, etc.  I think my husband (pc user) clicked it away.  Any ideas how to retrieve it?

    My safari menu bar is missing.  The menu bar for desktop, HD, and apps appears, but when I click on Safari, it disappears, so I can no longer see my buttons for History, etc.  I think my husband (pc user) clicked it away when borrowing my computer.  Any ideas how to retrieve it?  Thanks. 

    I too was having the same problem However, I could access both the menu bar and the dock by hovering my mouse over them so it wasn't a huge problem but I prefered having it there anyway. I was not in full screen mode and I could still go into full screen mode if I wanted to.  I found the easiest solution was to just quit safai and restart it, but it might not work for you considering you couldn't access you menu bar either way.
    I found this article that allows you to hide/show the menu bar and the dock through TextEdit (didn't work for me) http://www.mactricksandtips.com/2009/07/hide-the-menubar-or-dock-in-specific-app s.html It is pretty old so it might not work for lion and a bit risky if you don't know what you're doing so I wouldn't really recommend doing it this way.
    And KSheppard, I know it's not really any of my buisness, but the way to get answers to a question isn't by insulting others and being quick-tempered. Even if you feel like you were insulted first, don't try snapping at people who aren't obligated to help you. Honestly, it just makes everything easier if everybody is cooperative and polite.

  • CPALookupException Couldn't retrieve outbound binding

    Hi gurus,
    We're working on our test environment and we have a strange error:
    com.sap.aii.af.ra.ms.api.ConfigException: ConfigException in XI
    protocol handler. Failed to determine a receiver agreement for the
    given message. Root cause:
    com.sap.aii.af.service.cpa.impl.exception.CPALookupException: Couldn't
    retrieve outbound binding for the given P/S/A values:
    FP=;TP=;FS=BS_XIT_IT_ADYCLNT100;TS=BS_XIT_IT_INCAS_VALDOBBIADENE;AN=MI_AnagrArticoli_IN;ANS=http://goldenlady.it/it/Incas/I03/AnagrArticoli001
    The receiver agreement and the other objects in the scenario exist and
    work properly in the development scenario, while in the test system we
    have this error. Looking at the cache of the test XI system we can see
    all the configuration objects, also the receiver agreements that we
    need.
    We have already refreshed all the caches and also restarted the java
    instance but the problem still remains...
    By the way, we noticed a strange behaviour because the log files about
    this errors are written not in the folder that refers to the test
    system (XIT) but in the one that refers to the development system
    (XID). Could this be a problem connected to our errors?
    We suppose that the adapter frameworks looks in the wrong CPACache (the development instead of the test one).
    Points rewards good answers
    Mattia

    Hi,
    Please do the following it will solve the problem:
    Prerequisites:
    check the correctness of configuration of your scenario at your end.
    Please do the following:
    1) Check destination INTEGRATION_DIRECTORY_HMI in SM59. Does it returns a HTTP status of 500 with reqid not found. It means RFC is working fine.
    2) http://xihostname:port/CPACache/refresh?mode=full  
    with PIAFUSER and check whether it shows the correct output or not. Extremely important: check whether the authorization error is there or not for services users.
    3) Check the services in SAP XI in visual admin
    4) Reimport of SAP Basis content is done properly or not.
    5) If possible try to restart the J2EE server.
    6) Also check the inconsistency of SLD using SAP note no:
    764176
    Hope it will solve your problem.
    Thanks & Regards
    Prabhat

  • My all voice memos are deleted,how to retrieve them

    my all voice memos are deleted after syncing it with itunes...how to retrieve them ??

    Thanks Bro. I have backup. and I did the same thing twice but only 26 contacts appear on the device. Now again yesterday after your suggestion again I restored the device but the result was same. Then I thought a new thing. I restored the device one more time but after restoring I didn't configure the icloud account. Surprisingly all my old contacts are there in the device but those 26 contacts are not there. Now I will tell you how this must have happened? I had 3gs earlier. that was stolen 3 months ago. I put the device in lost mode. I purchased new iphone4. I restored with itune. All my data came back. After that I saved these 26 new contacts to my device which also saved in icloud but when I tried to backup on my pc it was not happening. the messege coming device disconnected. 2 days back my stolen device came online. Lost mode was activated by icloud. But what I think in between that time the other fellow must have deleted the phone contacts. And as per icloud also deleted the same. Only the 26 contacts which I saved in these 3 months remained in icloud. Now bro can u help me out? What I should do? I have 26 contacts in icloud and < 500 in my device. I don't understand when all other Co's mobile you can import contacts from any backup file iphone can not. This is the DRAWBACK OF IPHONE.

  • I accidently deleted my voice memos on my iphone. i was using itunes on two different computers and my voice memos are gone. DOES ANYONE KNOW HOW TO RETRIEVE MY LOST VOICE MEMOS? PLEASE HELP!

    itunes asked me if iwanted to erase all my files on my iphone when i connected it to my second computer.
    i clicked yes
    and all of my very important voice memos were deleted
    however none of my photos were deleted...... and they count as files don't they?
    anyway i need help on how to retrieve deleted voice memos
    PLEASE HELP!!!

    You should never try to sync your phone with more than one computer or you will lose your data.  The pictures were not deleted because the sync process does not touch Camera Roll pictures (it only includes them during the backup step of the sync process).
    If you had these voice memos on your phone when you last synced it to your first computer, and if you haven't synced to this computer since then, you could restore from the backup created during your last sync.  This will replace the data on your phone with the data from this older backup so anything new will be lost.  If you think that is the case, do not sync your phone again to the first computer prior to restoring from this backup or you will overwrite it and the backup will be lost.  Instead, prior to connecting your phone to your first computer, open iTunes and disable automatic syncing by going to iTunes Preferences and on the Devices tab checking "Prevent...from syncing automatically".  Then connect your phone and when it appears in iTunes on the left sidebar right-click on its name and select Restore From Backup and choose your last backup (containing your voice memos).
    If you didn't have these voice memos on your phone when you last synced to your first computer, or if you have synced again to your first computer since losing your data, then your voice memos and other data are lost.

  • How to retrieve sharepoint list data and show it on excel-addin using C#

    Hi,
    we have a sharepoint list where all students are present. we wanted to get the data from the list and show it via excel addin (VSTO) (something like save,retrieve buutons) . we have some more business logic which need to be performed before the data is retrieved
    . once data is shown on excel , user modifies it and update/save the record back to sharepoint.
    can you please give some samples and suggest any links to start with development.
    Thanks
    chaitu

    Hi chaituatp,
    For this requirement, I would suggest you to get familiar with how to create VSTO applications, and how SharePoint object model works. Here are some sample code about this:
    How to: Retrieve List Items using JavaScript:
    http://msdn.microsoft.com/en-us/library/hh185007(v=office.14).aspx
    http://msdn.microsoft.com/en-us/library/office/ee534956(v=office.14).aspx
    VSTO application show data in datagridview:
    http://stackoverflow.com/questions/16926275/simple-example-of-vsto-excel-using-a-worksheet-as-a-datasource
    Thanks,
    Qiao
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Qiao Wei
    TechNet Community Support

  • How to retrieve 2 values from a table in a LOV

    Hi
    I'm pretty new to APEX. I try to retrieve two values from a table using a LOV. I have a table named DEBIT with then columns SITE, NAME and KEY
    I want to display NAME to the user in a list. When the user select an item from the list, I want to retrieve the data of the SITE and KEY column of this item in order to launch an SQL command based on this two values.
    How to retrieve thes two values whant the user chooses an item from the list ?
    I apologize for my english, being french.
    Regards.
    Christian

    Christian,
    From what I understood about your requirement, you want a 'select list with submit' which displays "NAME" and based on the value selected, you want to get the corresponding values for "SITE" and "KEY" from the table.
    <b>Step 1: Create a select list with submit, say P1_MYSELECT </b><br><br>
    Use something like this in the dynamic list of values for the select list: <br>
    SELECT NAME display_value, NAME return_value
    FROM DEBIT<br><br>
    <b>Step 2: Create a page process of type PL/SQL block. Also create 2 hidden items P1_KEY and P1_SITE. </b><br><br>
    In the PL/sQL, write something like:
    DECLARE
      v_key DEBIT.KEY%TYPE;
      v_site DEBIT.SITE%TYPE;
      CURSOR v_cur_myvals IS
              SELECT KEY, SITE
              FROM DEBIT
              WHERE NAME = :P1_MYSELECT;
    BEGIN
      OPEN v_cur_myvals;
      LOOP
              FETCH v_cur_myvals
              INTO  v_key,v_site;
              EXIT WHEN v_cur_myvals%NOTFOUND;
    :P1_KEY := v_key;   
    :P1_SITE := v_site; 
      END LOOP;
      CLOSE v_cur_myvals;
    END; <br><br>
    Then you can use these values for whatever purpose you need to.
    Hope this helps.

  • How to retrieve the values from a table if they differ in Unit of Measure

    How to retrieve the values from a table if they differ in Unit of Measure?

    If no data is read
    - Insure that you use internal code in SELECT statement, check via SE16 desactivating conversion exit on table T006A. ([ref|http://help.sap.com/saphelp_nw70/helpdata/en/2a/fa0122493111d182b70000e829fbfe/frameset.htm])
    If no quanity in result internal table
    - There is no adqntp field in the internal table, so no quantity is copied in itab ([ref|http://help.sap.com /abapdocu_70/en/ABAPINTO_CLAUSE.htm#&ABAP_ALTERNATIVE_1@1@]).
    - - Remove the CORRESPONDING, so quantity will fill the first field adqntp1.  ([ref|http://help.sap.com/abapdocu_70/en/ABENOPEN_SQL_WA.htm])
    - - Then loop at the internal table and move the quantity when necessary to the 2 other fields.
    * Fill the internal table
    SELECT msehi adqntp
      INTO TABLE internal table
      FROM lipso2
      WHERE vbeln = wrk_doc1
        AND msehi IN ('KL','K15','MT').
    * If required move the read quantity in the appropriate column.
    LOOP AT internal_table ASSIGNING <fs>.
      CASE <fs>-msehi.
        WHEN 'K15'.
          <fs>-adqnt2 = <fs>-adqnt1.
          CLEAR <fs>-adqnt1.
        WHEN 'MT'.
          <fs>-adqnt3 = <fs>-adqnt1.
          CLEAR <fs>-adqnt1.
      ENDCASE.
    ENDLOOP.
    - You could also create another table with only fields msehi and adqntp and then collect ([ref|http://help.sap.com/abapdocu_70/en/ABAPCOLLECT.htm]) the data to another table.
    Regards,
    Raymond

  • How to Retrieve the Selected Values from selectOrderShuttle using ADF 11g

    Hi Every One,
    Does anyone has idea how to retrieve the selected Items using shuttle and Order of the items using 'SelectOrderShuttle' component ?
    Thanks

    shuttle's valuechangeevent would fire when you shuttle items back and forth.
        public void selectOrderShuttle1_valueChangeListener(ValueChangeEvent valueChangeEvent) {
            ArrayList list = new ArrayList(Arrays.asList(valueChangeEvent.getNewValue()));
            if (list != null){
                for (int i=0; i<list.size(); i++) {
                    int l = list.size()-1;
                    val = list.get(l).toString(); //returns , delimited string
                    if (val != null){
                        val = val.replaceAll("[\\[\\]]", "");
                        StringTokenizer st = new StringTokenizer (val, ",");
                        int nto = st.countTokens ();
                        for (int j = 0; j < nto; j++)
                            String token = st.nextToken ();                     
                ..........

  • How to retrieve multiple data from table and represent it in jsp page

    Hi
    The below JavaScript code is used to add row in the table when I want to add multiple row data into table for single entry no field.
      <html>  function addRow()
                i++;
                var newRow = document.all("tblGrid").insertRow();
                var oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='srno"+i+"' type='text' id='srno"+i+"' size=10>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='itmcd"+i+"' type='text' id='itmcd"+i+"' size='10'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='itmnm"+i+"' type='text' id='itmnm"+i+"' size='15'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='indentqty"+i+"' type='text' id='indentqty"+i+"' size='10'>";
                oCell = newRow.insertCell();
                    oCell.innerHTML = "<input name='uom"+i+"' type='text' id='uom"+i+"' size='10'><input type='hidden' name='mcode"+i+"'id='mcode"+i+"'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='packqty"+i+"' type='text' id='packqty"+i+"' size='10'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='packuom"+i+"' type='text' id='packuom"+i+"' size='10'><input type='hidden' name='pack"+i+"' id='pack"+i+"'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='rate"+i+"' type='text' id='rate"+i+"' size='10'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='dor"+i+"' type='text' id='dor"+i+"' size='0' onClick='"+putdate(this.name)+"'>";           
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='bccode"+i+"' type='text' id='bccode"+i+"' size='10'></td><input type='hidden' name='bcc"+i+"' id='bcc"+i+"'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='cccode"+i+"' type='text' id='cccode"+i+"' size='10'></td><input type='hidden' name='ccc"+i+"' id='ccc"+i+"'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='remark2"+i+"' type='text' id='remark2"+i+"' size='20'>";           
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input type='button' value='Delete' onclick='removeRow(this);' />";
               // oCell = newRow.insertCell();
               // oCell.innerHTML = "<input type='button' value='Clear' onclick='clearRow(this);' />";
            }<html>  Then this data are send to the next Servlet for adding into two table.
    My header portion data are added into one table which added only one row in table. while footer section data are added into the no of rows in another table dependent on No. of
    Rows added into jsp page.
    Here is an code for that logic.
    <html>
    ArrayList<String> mucode = new ArrayList<String>();
                                ArrayList<Integer> serials = new ArrayList<Integer>();
                                ArrayList<Integer> apxrate = new ArrayList<Integer>();
                                ArrayList<Integer> srname = new ArrayList<Integer>();
                                ArrayList<String> itcode = new ArrayList<String>();
                                ArrayList<String> itname = new ArrayList<String>();
                                ArrayList<Integer> iqnty = new ArrayList<Integer>();
                                ArrayList<String> iuom = new ArrayList<String>();
                                ArrayList<Integer> pqnty = new ArrayList<Integer>();
                                ArrayList<String> puom1 = new ArrayList<String>();
                               ArrayList<Integer> arate = new ArrayList<Integer>();
                                ArrayList<String> rdate = new ArrayList<String>();
                                ArrayList<String> bcs = new ArrayList<String>();
                                ArrayList<String> ccs = new ArrayList<String>();
                                ArrayList<String> remarkss = new ArrayList<String>();
                                //ArrayList<Integer> qtyrecs = new ArrayList<Integer>();
                                //ArrayList<String> dors = new ArrayList<String>();
                                //ArrayList<String> remarks = new ArrayList<String>();
                     String entryn = request.getParameter("entryno");       
                        String rows = request.getParameter("rows");
                        out.println(rows);  
                        //String Entryno = request.getParameter("entryno");
                       // out.println(Entryno);
                      int entryno = 0,reqqty = 0,srno = 0,deprequest = 0,rowcount = 0;
                                if(!Entryno.equals("")){
                                        entryno = Integer.valueOf(Entryno);
                                if(!rows.equals("")){
                                        rowcount = Integer.valueOf(rows);
                               for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("srno"+i)!=null){
                                                serials.add(Integer.valueOf(request.getParameter("srno"+i).trim()));
                                                out.println(serials.size());
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("srno"+i)!=null){
                                                srname.add(Integer.valueOf(request.getParameter("srno"+i).trim()));
                                out.println(srname.get(0));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("itmcd"+i)!=null){
                                                itcode.add(request.getParameter("itmcd"+i).trim());
                                        } //out.println(itcode.get(i));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("itmnm"+i)!=null){
                                                itname.add(request.getParameter("itmnm"+i).trim());
                                        }//out.println(itname.get(i));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("indentqty"+i)!=null){
                                                iqnty.add(Integer.valueOf(request.getParameter("indentqty"+i).trim()));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("uom"+i)!=null){
                                                iuom.add(request.getParameter("uom"+i).trim());
                                        }//out.println(iuom.get(i));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("mcode"+i)!=null){
                                                mucode.add(request.getParameter("mcode"+i).trim());
                               for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("packqty"+i).equals("")){
                                          pqnty.add(0);
                                        }else
                                            pqnty.add(Integer.valueOf(request.getParameter("packqty"+i).trim()));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("pack"+i)!=null){
                                                puom1.add(request.getParameter("pack"+i).trim());
                                       }else
                                        puom1.add("");
                               for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("rate"+i).equals("")){                                     
                                            arate.add(0);
                                        }else
                                        arate.add(Integer.valueOf(request.getParameter("rate"+i).trim()));   
                     /* for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("rate"+i)!=null){
                                                arate.add(Integer.valueOf(request.getParameter("rate"+i).trim()));
                              for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("dor"+i)!=null){
                                                try{
                                                        rdate.add(dashdate.format(slashdate.parse(request.getParameter("dor"+i).trim())));
                                                }catch(ParseException p){p.printStackTrace();}
                                        }else
                                           { rdate.add("");}
                                   for(int i=1;i<=rowcount;i++){
                                 if(request.getParameter("bcc"+i)!=null){
                                                bcs.add(request.getParameter("bcc"+i).trim());
                                        }out.println(bcs.get(0));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("ccc"+i)!=null){
                                                ccs.add(request.getParameter("ccc"+i).trim());
                                        }out.println(ccs.get(0));
                                for(int i=1;i<=rowcount;i++){
                                    out.println("remark2");
                                        if(request.getParameter("remark2"+i)!=null){
                                                remarkss.add(request.getParameter("remark2"+i).trim());
                                        }out.println(remarkss.get(0));
                        ArrayList<String> Idate = new ArrayList<String>();
                        for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("dateindent"+i)!=null){
                                                try{
                                                        Idate.add(dashdate.format(dashdate.parse(request.getParameter("dateindent"+i).trim())));
                                                }catch(ParseException p){p.printStackTrace();}
                    String Rdate = dashdate.format(new java.util.Date());
                     String tdate = dashdate.format(new java.util.Date());    
                     // String Indentdate = dashdate.format(new java.util.Date());
                   //  String ApprovedT1 = dashdate.format(new java.util.Date());
                   //  String ApprovedT2 = dashdate.format(new java.util.Date());
                       // String ApprovedT1=" ";
                        //String ApprovedT2="";*/
                    String ApprovedT1= dashdate.format(new java.util.Date());
                   out.println (ApprovedT1);
                      String ApprovedT2=dashdate.format(new java.util.Date());
                       out.println(ApprovedT2);
                    String Indentdate=(dashdate.format(slashdate.parse(request.getParameter("dateindent").trim())));
                       out.println(Indentdate);
                        String Cocode ="BML001";  
                        out.println(Cocode);
                        String Deptcode = request.getParameter("dept1");
                        out.println(Deptcode);
                        String Empcode = request.getParameter("emp");
                        out.println(Empcode);
                        String Refno =request.getParameter("rtype"); 
                         out.println(Refno);
                        String Divcode = request.getParameter("todiv1");
                        out.println(Divcode);
                        String Usercode = "CIRIUS";    
                         String Whcode = request.getParameter("stor");
                        out.println(Whcode);
                        // String Itemgroupcode = request.getParameter("");
                         String Itemgroupcode ="120000";
                         out.println(Itemgroupcode);
                        String Supplytypecode = request.getParameter("stype");
                        out.println(Supplytypecode);
                        String Delcode = request.getParameter("deliverycode");
                        out.println(Delcode);
                        String Itemclass="WS";
                        out.println(Itemclass);
                        // String Itemclass = request.getParameter("iclass");
                       // out.println(Itemclass);
                        String unitcode = request.getParameter("uni");
                        out.println(unitcode);
                         String Todivcode = request.getParameter("todiv1");
                        out.println(Todivcode);
                        String Appxrate = request.getParameter("rate");
                        out.println(Appxrate);
                        String Srno = request.getParameter("srno");
                        out.println(Srno);                
                    /*    String Indqty = request.getParameter("indentqty");
                      out.println(Indqty);*/
                  String Itemcode = request.getParameter("itmcd");
                       out.println(Itemcode);
                       String Othersp = request.getParameter("remark1");
                        out.println(Othersp);
                        String Reqdt = request.getParameter("dor");
                        out.println(Reqdt);
                        String Munitcode = request.getParameter("mcode");
                        out.println(Munitcode);
                        String Packqty = request.getParameter("packqty");
                        out.println(Packqty);               
                        String Packuom = request.getParameter("pack");
                        out.println(Packuom);
                        String Remark2 = request.getParameter("remark2");
                        out.println(Remark2);
                        String BC = request.getParameter("bcc");
                        out.println(BC);
                        String CC = request.getParameter("ccc");
                        out.println(CC);
                        try{
                            st=connection.createStatement();
                            connection.setAutoCommit(false);
                            String sql="INSERT INTO PTXNINDHDR(COCODE,DEPTCODE,EMPCODE,APPROVEDT1,APPROVEDT2,INDDT,ENTRYNO,REFNO,REMARKS,DIVCODE,USERCODE,WHCODE,ITEMGROUPCODE,SUPTYPECODE,DELCODE,UNITCODE,TODIVCODE,ITEMCLASS)VALUES('"+Cocode+"','"+Deptcode+"','"+Empcode+"','"+ApprovedT1+"','"+ApprovedT2+"','"+Indentdate+"',"+Entryno+",'"+Refno+"','"+Othersp+"','"+Divcode+"','"+Usercode+"','"+Whcode+"','"+Itemgroupcode+"','"+Supplytypecode+"','"+Delcode+"','"+unitcode+"','"+Todivcode+"','"+Itemclass+"')";
                            out.println(sql);
                            st.addBatch(sql);
                            for(int i=0;i<serials.size();i++){
                                out.println("Inside the Statement");
                                String query3="test query for u";
                                out.println(query3);
                               String queryx="Insert into PTXNINDDTL(APXRATE,ENTRYNO,BRKNO,INDQTY,ITEMCODE,OTHERSPFCS,MUNITCODE,PACKQTY,PACKUOM,REMARKS,DIMSUBGRPCODE,DIMCODE,REQDT)VALUES("+arate.get(i)+","+entryno+","+srname.get(i)+","+iqnty.get(i)+","+itcode.get(i)+",'"+Othersp+"','"+mucode.get(i)+"',"+pqnty.get(i)+",'"+puom1.get(i)+"','"+remarkss.get(i)+"','"+bcs.get(i)+"','"+ccs.get(i)+"','"+rdate.get(i)+"')";
                               out.println(queryx);
                                st.addBatch(queryx);
                           int[] result=st.executeBatch();
                           connection.commit();
                           for(int k=0;k<result.length;k++)
                           out.println("rows updated by "+(k+1)+"insert sta:"+result[k]+"");
                        catch(BatchUpdateException bue)
                        out.println("error1;"+bue+"");
                        catch(SQLException sql)
                        out.println("error2;"+sql+"");
                        catch(Exception l)
                        out.println("error3;"+l+"");
    </html>
       Now I looking for to retrieve this footer section data available in multiple rows from footer table and present it in jsp page .
    I am finding difficulties in how to show this multiple row data for dynamic no of rows .i.e. variable no. of rows.
    I have able to show the data in Header portions of page in this ways
    here i am adding the part of code which shows the data from header part of table i.e from Header table
      <html>
    <h2 align="center"><b>Indent Preparation</b></h2>
        <div align="left">
            <table width="849" border="0" cellspacing="3" cellpadding="3" align="center">
                <tr>
                    <td ><div align="left"><b>Indent No.</b></div></td>
                    <td ><label>
                            <input name="indentno" type="text" id="indentno" size="15" value="" /><input type="hidden" name="no" id="no">
                    </label></td>
                    <td ><div align="center"><strong>Indent Date</strong></div></td>
                    <td ><label>
                            <div align="center">
                                <input name="dateindent" type="text" id="dateindent"value="<%=date1%>"/><input type="hidden" name="no" id="no">
                            </div>
                    </label></td>
                    <td> </td>
                    <td><div align="right"><strong>Entry No.</strong></div></td>
                     <%if(oper!=null && oper.equals("view") && hdrcode!=null && hdrdetails!=null){%>
            <td><input type="text" value="<%=hdrcode.get(3)%>" size="10"></td>
    <%}else{%>
                   <td><input type="text" name="entryno" id="entryno" value="<%=entryNo%>"/></td>
                             <%}%>
                            <div align="right"></div>
                </tr>
                <tr>
                    <td><b>Division</b></td>
                    <%if(oper!=null && oper.equals("view") && hdrcode!=null && hdrdetails!=null){%>
    <td><input type="text" value="<%=hdrdetails.get(9)%>" size="20"</td>
    <td><input type="hidden" name="div1" id="div1" value='<%=hdrcode.get(10)%>'></td>
    <%}else{%>
                   <td><input type="text" name="div" id="div" /></td>
                   <td><input type="hidden" name="div1" id="div1" /> </td>
              <%}%>
                    <td> </td>
                    <td> </td>
                    <td><div align="right"><strong>Unit</strong></div></td>
                   <%if(oper!=null && oper.equals("view") && hdrcode!=null && hdrdetails!=null){%>
    <td><input type="text" value="<%=hdrdetails.get(14)%>" size="20"</td>
    <td><input type="hidden" name="uni" id="uni" value='<%=hdrcode.get(12)%>'></td>
    <%}else{%>
                   <td><input type="text" name="unit" id="unit" /></td>
                   <td><input type="hidden" name="uni" id="uni" /> </td>
              <%}%>
                </tr>
                <tr>
    </html>
      Any suggestion on any above works is highly appreciated.
    Thanks and regards
    harshal

    Too much code. It's also not well intented nor formatted. I don't see a question either or it got lost in that heap of unformatted code.
    I will only answer the question in the thread's subject:
    How to retrieve multiple data from table and represent it in jsp pageTo retrieve, make use of HttpServletRequest#getParameterValues() and/or #getParameter().
    To display, make use of JSTL's c:forEach.

  • How to Retrieve a Crystal Report's Unmanaged Destination Filename

    Hi all,
    I have looked very closely at Robert Twigg's response to the post "[Destination Path and name of a scheduled Report|http://forums.sdn.sap.com/thread.jspa?messageID=9588160#9588160]" dated 9/1/10 and while it does retrieve the unmanaged destination path, the filename retrieved is the managed filename.  How does one go about retrieving an instance's unmanaged filename?
    When I look at a Crystal Report instance details, it definitely knows what the unmanaged filename that was populated, here is a sample instance detail:
    External Destination: File copy the instance with the filename: "ALOG_Deferred_Clearing_RPT_2011-12-13-11-43-09.pdf" to the folder: "/apps/efs_bobj/IMPL/XX" .
    As you can clearly see, the filename consists of report name, date, and time that was specified as "%SI_NAME%_%SI_STARTTIME%.%EXT%" in the destination filename.
    Here's the snippet to retrieve the managed filename:
    IInfoObject report = (IInfoObject) reports.get(0);
    // Get the file name from the instance.
    IFiles files = (IFiles) report.getFiles();
    IFile file = (IFile) files.get(0);
    Any insight on how to retrieve an instance's unmanaged filename would be highly appreciated.
    Thanks in advance,
    Hart Penn
    Edited by: hartpenn on Dec 14, 2011 2:14 PM
    Edited by: hartpenn on Dec 14, 2011 2:15 PM
    Edited by: hartpenn on Dec 14, 2011 2:19 PM

    Thank you for your response.  I am querying for the report instances using the query below:
    IInfoObjects iRptObjects = infoStore.query("SELECT * FROM CI_INFOOBJECTS " +
                                               "Where SI_KIND='Pdf' AND " +
                                               "SI_INSTANCE>0 ");
    Collection<IInfoObject> iRptObjs = iRptObjects;
    for (IInfoObject iRptObj : iRptObjs) {
        ISchedulingInfo iSchedInfo = iRptObj.getSchedulingInfo();
        IEvents triggerEvents = iSchedInfo.getDependants();
        if (triggerEvents.size() > 0) {
            for (int j=0; j < triggerEvents.size(); j++) {
                IInfoObjects events = (IInfoObjects)infoStore.query("SELECT * FROM CI_SYSTEMOBJECTS " +
                                                                    "Where SI_KIND='Event' AND " +
                                                                    "SI_ID=" + (Integer) triggerEvents.get(j));
                if (events.size() > 0) {
                    IEvent curEvent = (IEvent)events.get(0);
        IDestinationPlugin destPlugin =
            (IDestinationPlugin) infoStore.query("Select Top 1* from CI_SYSTEMOBJECTS " +
                                                 "Where SI_NAME = 'CrystalEnterprise.DiskUnmanaged'").get(0);
        IDestinations dests = iSchedInfo.getDestinations();
        Collection<IDestination> destObjs = dests;
        if (dests.size() > 0) {
            // we have a dest set up
            for (IDestination destObj : destObjs) {
                if (destObj.getName().compareTo("CrystalEnterprise.DiskUnmanaged") == 0) {
                    // Copy the destination properties to the destination plugin.
                    destObj.copyToPlugin(destPlugin);
                    // Get the scheduling options for the unmanaged disk.
                    IDiskUnmanagedOptions diskUnmanagedOptions =
                        (IDiskUnmanagedOptions) destPlugin.getScheduleOptions();
                    // Get the destination files
                    List destFiles = diskUnmanagedOptions.getDestinationFiles();
                    String pathName = (String)destFiles.get(0);
        IFiles iFiles = (IFiles) iRptObj.getFiles();
        IFile myFile = (IFile) iFiles.get(0);
        logger.debug("Object: " + iRptObj.getTitle() +
                     ", ID: " + iRptObj.getID() +
                     ", Kind: " + iRptObj.getKind() +
                     ", Trigger Event: " + curEvent.getEventName());
        logger.debug("Dest: " + pathName);
        logger.debug("Filename: " + myFile.getName());
    while this is not efficient, it does retrieve the instances. However, the file name returned is not what was specified in the destination filename. Here is some info returned and displayed:
    Object: ALOG_Deferred_Clearing_RPT, ID: 128776, Kind: Pdf, Trigger Event: EVT_121311_114308
    Dest: /apps/efs_bobj/IMPL/XX/%SI_NAME%_%SI_STARTTIME%.%EXT%
    FileName: ~ce46086dd492ac788.pdf
    As you can see, the filename is clearly the managed filename.
    Edited by: hartpenn on Dec 14, 2011 3:43 PM
    Edited by: hartpenn on Dec 14, 2011 4:02 PM
    Edited by: hartpenn on Dec 14, 2011 4:03 PM
    Edited by: hartpenn on Dec 14, 2011 4:17 PM
    Edited by: hartpenn on Dec 14, 2011 4:26 PM
    Edited by: hartpenn on Dec 14, 2011 4:27 PM
    Edited by: hartpenn on Dec 14, 2011 4:28 PM

  • How To Retrieve an Object's Value Defined Using c:set ... Tag?

    I have the value of a variable defined in JSP#1 (JSP#1 is not a form) using JSTL tag:
       <c:set var="id" value="${articleForm.article}" scope="session"/>Now, I have an object 'id' in the session scope. The object 'id' and all the information, which are defined in JSP#1, are forwarded to JSP#2.
    JSP#2 is a form. But, the 'id' is not used in JSP#2.
    JSP#2 has a submit button and then, a servlet takes over the control after that button is clicked. All the text fields in JSP#2 together with the object 'id' are forwarded to this servlet.
    I have two questions:
    1. I should put this object 'id' in a request scope or a session scope? Currently, it is in a session scope.
    2. How to retrieve the value of this object 'id' in this servlet? (I do not want to print the value out. I want to retrieve the value and store it in a database.)
        int articleID = Integer.parseInt( session.getAttribute( "id" ) );   or, it should be retrieved in another way?

    I'm not sure you understand the concept of a session object.
    Java objects stay on the server. There is no transmission between the web browser and the client.
    The scope just sets how long the server "remembers" that variable.
    request scope - only lasts one request. Once a web page is returned to the client, the server forgets all request variables.
    session scope - lasts for one user - across multiple requests/web pages.
    1. I should put this object 'id' in a request scope or a session scope? Currently, it is in a session scope.From your description, you appear to have it right - your object should be in session scope.
    2. How to retrieve the value of this object 'id' in this servlet? (I do not want to print the value out. I want to retrieve the value and store it in a database.)If articleForm.article is an String then that looks the right way to access it.
    You might have to do it like this:
    int articleID = Integer.parseInt( (String)session.getAttribute("id"));
    The Integer.parseInt method takes a String as a parameter - while session.getAttribute() returns an Object.
    This code will work if the object stored in the session is a String.
    The object stored in the session is ${articleForm.article} What type does articletForm.getArticle() return? That is the type you need to cast it to when retrieving it from the session.
    Cheers,
    evnafets

  • How to retrieve values from the struts DAO to Struts JSP

    Hi friends,
    I have one question. i want to display values in the struts jsp file from the struts DAO class. can anyone tell how do it.
    Appreciated for your help.
    Thanks
    G1 :)

    Hi Santosh,
    Thanks for your prompt reply.
    Actually, my problem is i want to display complete rows from the DAO to JSP page. I'm displaying all the rows in the DAO from DB.
    But i dont know how to retrieve all these data from DAO. Can i take arraylist.??
    DAO:
    ------------     public Customers getData(Customers customers){ // Reading data from DB
         //ArrayList list = null ;
         try
              Connection conn = getSQLConnection();
              Statement statement = conn.createStatement();
              String qry = "select * from register";
              ResultSet resultSet = null;
              PreparedStatement pstat = conn.prepareStatement(qry);
              // pstat.setString(1, customers.getFname());
              resultSet = pstat.executeQuery();
    //Print the data to the console
    while(resultSet.next()){
              String fnam = resultSet.getString(1);
              String lnam = resultSet.getString(2);
              String gen = resultSet.getString(3);
              String addres = resultSet.getString(4);
              String cit = resultSet.getString(5);
              String zip = resultSet.getString(6);
              String county = resultSet.getString(7);
              String emal = resultSet.getString(8);
              System.out.println("First name:"+fnam);
              System.out.println("Last name:"+lnam);
              System.out.println("Address:"+addres);
              customers.setFname(fnam);
              customers.setLname(lnam);
              customers.setGender(gen);
              customers.setAddress(addres);
              customers.setCity(cit);
              customers.setZipcode(zip);
              customers.setCountry(county);
              customers.setEmail(emal);
                   statement.close();
                   conn.close();
              }catch(Exception e1){
                   e1.printStackTrace();
              return customers;
    Bean:
    I have specified in this line in Bean:
    request.getSession().setAttribute("customers", customers);
    But in JSP. how will i populate all these data. Pls..send some code.
    I'm sorry this is just practicals. i'm not doin any real time project. that;s why i have placed all these code.
    Thanks for your patience for resolving my problems.
    Thanks
    G1

  • How to retrieve value from xml file

    hi all,
    can somebody pls tell me how to retrieve value from xml file using SAXParser.
    I want to retrieve value of only one tag and have to perform some validation with that value.
    it's urgent .
    pls help me out
    thnx in adv.
    ritu

    hi shanu,
    the pbm is solved, now i m able to access XXX no. in action class & i m able to validate it. The only thing which i want to know is it ok to declare static ArrayList as i have done in this code. i mean will it affect the performance or functionality of the system.
    pls have a look at the following code snippet.
    public class XMLValidator {
    static ArrayList strXXX = new ArrayList();
    public void validate(){
    factory.setValidating(true);
    parser = factory.newSAXParser();
    //all factory code is here only
    parser.parse(xmlURI, new XMLErrorHandler());     
    public void setXXX(String pstrXXX){          
    strUpn.add(pstrXXX);
    public ArrayList getXXX(){
    return strXXX;
    class XMLErrorHandler extends DefaultHandler {
    String tagName = "";
    String tagValue = "";
    String applicationRefNo = "";
    String XXXValue ="";
    String XXXNo = "";          
    XMLValidator objXmlValidator = new XMLValidator();
    public void startElement(String uri, String name, String qName, Attributes atts) {
    tagName = qName;
    public void characters(char ch[], int start, int length) {
    if ("Reference".equals(tagName)) {
    tagValue = new String(ch, start, length).trim();
    if (tagValue.length() > 0) {
    RefNo = new String(ch, start, length);
    if ("XXX".equals(tagName)) {
    XXXValue = new String(ch, start, length).trim();
    if (XXXValue.length() > 0) {
    XXXNo = new String(ch, start, length);
    public void endElement(String uri, String localName, String qName) throws SAXException {                    
    if(qName.equalsIgnoreCase("XXX")) {     
    objXmlValidator.setXXX(XXXNo);
    thnx & Regards,
    ritu

Maybe you are looking for

  • Problem with v and w in a cube

    Hi, I have problem with 'v' and 'w' in an Analysis Services cube (SQL Server 2008R2). The example is employee number 'frvi' and 'frwi'. The cube summarize both employee's measures to employee number 'frvi'. And does not show the employee number 'frwi

  • Customer by payment term

    Hi, User would like to have a report for a certain sales office and sales group, list of all customer having payment term XX Does anyone know such kind of a report

  • Do I use columns to create this template?

    How do I create a template that allows me to have 3 text columns that flow vertically, but not into each other?  So I want to take notes in the Middle column, be able to notate my questions/thoughts about the  Middle column notes in the Left column (

  • Need Help with Uploading IPA to AppStore

    Having some troubles uploading my completed IPA to the appstore. 1) Using Flash Professional CC 2) Built with Air 3.8 for iOS 3) Uploading it via Application Loader 4) Encountered the following errors:      >> Apple's web service operation was not su

  • Install Maverick on new Ext disk, says "Disk is Locked"

    Hello everyone, new here.  So my late '09 imac 21.5" running Maverick has been running incredibly slow lately (before installing Maverick), like moving the cursor across the screen and it has to load for a few second before it catches up, multiply th