jquery is getting the old values from database

Posted by sansknwoledge on Stack Overflow See other posts from Stack Overflow or by sansknwoledge
Published on 2010-03-23T09:01:55Z Indexed on 2010/03/23 9:33 UTC
Read the original article Hit count: 136

Filed under:
|
|

hi in my jsp page i am a having a jquery area which pass the values to a servlet which returns an output of dropdownlist . then the jsp file do some updation so certain values which are in the dropdownlist should not be there while repopulating. but it is not happening. my jquery code is

 $("#cbocode").change(function(){
   var cdid=$("#cbocode option:selected");
   $.get("trnDC?caseNo=20&cdid="+cdid.text(),function(data){
       $("#divinstrument").html(data);
   })

and the servlet code is

 case 20:{ //jquery call
                    String cdid=(String) request.getParameter("cdid");
                    Statement st = con.createStatement();
                    ResultSet rs = st.executeQuery("select instrumentid from mstinstrument where codeid='" + cdid + "' and rec_Status='A' and statusid='U' and Agentid='METLAB'");
        if (!rs.wasNull()){
                    //List data=new ArrayList();
                    String v="<select id=cboinstr>";
                   while (rs.next())
                   {
                    //   data.add(rs.getString("vend_code"));
                     v += "<option>" + rs.getString("instrumentid").toString() + "</option>";
                   }
                    v+="</select>";
                    response.setContentType("text/html");
                    PrintWriter out = response.getWriter();
                    out.print(v);
                    }
                    else{
                        response.setContentType("text/html");
                    PrintWriter out = response.getWriter();
                    out.print("no data found");
                    }

where i am missing???

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about servlets