<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    軟體印象

    Kavin
    posts - 13, comments - 0, trackbacks - 0, articles - 0

    2012年6月7日

     

    DECLARE
      v_test_varray VARCHAR_VARRAY_TYPE := VARCHAR_VARRAY_TYPE('57610',
                                                               '61368',
                                                               '73111',
                                                               '37208',
                                                               '57639');
                                                               
    V_SQL        VARCHAR2(32767);
        V_SQL_IN     VARCHAR2(32767);
        V_SQL_ROWNUM VARCHAR2(32767);
        V_ORDER      VARCHAR2(32767);
        TYPE number_index_by_string IS TABLE OF NUMBER INDEX BY VARCHAR2(10);
        v_evt_id_list  NUMBER_INDEX_BY_STRING;
        
    Begin
      --orderArray VARCHAR_VARRAY_TYPE%type := VARCHAR_VARRAY_TYPE('11','22','33','44','55');

    /*  
      FOR i IN v_test_varray.FIRST .. v_test_varray.LAST LOOP
        IF v_test_varray.EXISTS(i) THEN
          DBMS_OUTPUT.put_line(i);
        END IF;
      END LOOP;
      
    */
      
      V_ORDER := Func_LIST_TO_ORDER(v_test_varray, 'A.COL_NAME');
      DBMS_OUTPUT.put_line('V_ORDER='||V_ORDER);
      
      V_SQL := 'SELECT * FROM TABLEA A'
               || ' WHERE '
               || ''
               || ''
               || ''
               || ''
               ;
      V_SQL := V_SQL || ' ( ' ||
                   FUNC_LIST_TO_IN_SQL(v_test_varray,
                                        'COL_NAME',
                                        ''''|| ')';
        V_SQL := V_SQL  ||
                 ' ORDER by ( ' || V_ORDER || ')';
                 
      DBMS_OUTPUT.put_line('V_SQL='||V_SQL);

    --- SET v_evt_id_list number_index_by_string

    FOR i IN v_test_varray.FIRST .. v_test_varray.LAST
      LOOP
         IF v_test_varray.EXISTS (i)
         THEN
            DBMS_OUTPUT.put_line (i);
            v_evt_id_list(v_test_varray(i)) := i;
         END IF;
      END LOOP;
      
    --- TEST v_evt_id_list number_index_by_string
      FOR i IN v_evt_id_list.FIRST .. v_evt_id_list.LAST
      LOOP
         IF v_evt_id_list.EXISTS (i)
         THEN
            DBMS_OUTPUT.put_line (i||' = '||v_evt_id_list(i) );
         END IF;
      END LOOP;
      
    -- GET v_evt_id_list number_index_by_string
      DBMS_OUTPUT.put_line (v_evt_id_list('73111') );

    posted @ 2013-02-04 16:47 Kavin 閱讀(236) | 評論 (0)編輯 收藏

    1. config servlet in web.xml
     <servlet>
         <servlet-name>addressData</servlet-name>
         <servlet-class>com.xxx.webapp.AddressDataAutoCompleteServlet</servlet-class>
         <load-on-startup>1</load-on-startup>
        </servlet>
       
    2. set autocomplete in JSP
    $().ready(function() {
     
     $("#addressLine1").autocomplete("<%=StrUtils.filterStr(request.getContextPath())%>/servlet/addressData?paramName=addressLine");
     $("#addressLine2").autocomplete("<%=StrUtils.filterStr(request.getContextPath())%>/servlet/addressData?paramName=addressLine2");
     $("#addressLine3").autocomplete("<%=StrUtils.filterStr(request.getContextPath())%>/servlet/addressData?paramName=addressLine3");
     $("#addressCity").autocomplete("<%=StrUtils.filterStr(request.getContextPath())%>/servlet/addressData?paramName=addressCity");
     $("#addressPostCode").autocomplete("<%=StrUtils.filterStr(request.getContextPath())%>/servlet/addressData?paramName=addressPostCode");
     $("#firstFocusObj").focus();
    });

    <html:text name="" tabindex="9" style="color: grey;" onclick="clearAddressValue(this)" styleId="addressLine1" value='<%=request.getAttribute("postalAddress1") == null ? defalutAddressValue : (String)request.getAttribute("postalAddress1")%>' property="TLContactDetailForm.postalAddress1" size="50" maxlength="50" styleClass="inputText2"></html:text>

    <input type="text" name="TLContactDetailForm.postalAddress1" maxlength="50" size="50" tabindex="9" value="Start typing your address and we will finish it for you" onclick="clearAddressValue(this)" id="addressLine1" style="color: grey;" class="inputText2">

    3. return addresses in java class: AddressDataAutoCompleteServlet.java

     

    package com.xxxxxx.webapp;

    import com.xxxxxx.exception.ServiceException;
    import com.xxxxxx.util.StrUtils;
    import com.xxxxxx.webapp.context.ServiceLocator;
    import com.xxxxxx.util.AddressShow;

    import java.io.IOException;
    import java.io.PrintWriter;

    import java.util.ArrayList;
    import java.util.List;

    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;

    import org.apache.log4j.Logger;


    /**
     * Servlet implementation class AddressDataAutoCompleteServlet
     */
    public class AddressDataAutoCompleteServlet extends HttpServlet {
        private static final long serialVersionUID = 1L;
        public Logger LOG = Logger.getLogger(this.getClass().getName());

        /**
         * @see HttpServlet#HttpServlet()
         */
        public AddressDataAutoCompleteServlet() {
            super();
        }
       
        /**
         * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
         *      response)
         */
        protected void doGet(HttpServletRequest request,
            HttpServletResponse response) throws ServletException, IOException {
            String paramName = request.getParameter("paramName");
            String paramValue = request.getParameter("q");
            LOG.info(paramName);
            LOG.info(paramValue);

            List list = new ArrayList();

            try {
                list = ServiceLocator.getAddressService()
                                     .searchAddressList(paramName, paramValue);
            } catch (ServiceException e) {
             LOG.error(e.getMessage(),e);
            }

            PrintWriter t_PW = response.getWriter();
           
            for (int i = 0; i < list.size(); i++) {
                String address = StrUtils.toTitleCase((String) list.get(i));

                if (paramName.equals("addressLine")) {
                 AddressShow.showAddress(t_PW,address);
                } else if (paramName.equals("addressLine1")) {
                 AddressShow.showAddress(t_PW,address);
                } else if (paramName.equals("addressLine2")) {
                 AddressShow.showAddress(t_PW,address);
                } else if (paramName.equals("addressLine3")) {
                 AddressShow.showAddress(t_PW,address);
                } else if (paramName.equals("addressCity")) {
                 AddressShow.showAddress(t_PW,address);
                } else if (paramName.equals("addressPostCode")) {
                 AddressShow.showAddress(t_PW,address);
                }
            }
        }

        /**
         * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
         *      response)
         */
        protected void doPost(HttpServletRequest request,
            HttpServletResponse response) throws ServletException, IOException {
            this.doGet(request, response);
        }
    }

     

     


    ------
    AddressShow.java

    package com.intl.cigna.util;

    import java.io.PrintWriter;

    public class AddressShow
    {
      public static void showAddress(PrintWriter pw, String input)
      {
        pw.write(input + "\n");

      }
    }

    posted @ 2012-06-07 22:39 Kavin 閱讀(302) | 評論 (0)編輯 收藏

    主站蜘蛛池模板: 亚欧乱色国产精品免费视频| 18勿入网站免费永久| 久久一区二区三区免费| 91精品国产免费入口| 亚洲高清成人一区二区三区 | 人妻在线日韩免费视频| 毛片免费视频播放| 黄网址在线永久免费观看 | 亚洲酒色1314狠狠做| 国产成人高清亚洲一区久久| 99爱在线观看免费完整版| 亚洲精品无码专区2| 最新国产精品亚洲| **实干一级毛片aa免费| 亚洲午夜福利在线观看| 亚洲成在人线aⅴ免费毛片| 最近中文字幕无免费| 亚洲综合日韩中文字幕v在线| 在线播放免费人成视频网站| 最近的免费中文字幕视频 | 亚洲一区二区三区久久久久| 99re6在线视频精品免费| 国产免费黄色大片| 日韩亚洲国产综合高清| 日本免费一本天堂在线| 亚洲成a人片在线观看精品| 99久久国产免费-99久久国产免费| 亚洲毛片在线免费观看| 免费精品99久久国产综合精品| 波多野结衣中文一区二区免费| 亚洲国产精品一区二区三区在线观看 | 久久性生大片免费观看性| 亚洲av日韩综合一区在线观看| 一级**爱片免费视频| 四虎免费永久在线播放| 中国极品美軳免费观看| 中国亚洲女人69内射少妇| 一级美国片免费看| 亚洲精品美女久久久久| 日韩伦理片电影在线免费观看| 伊人久久大香线蕉免费视频|