title: Improve the search functionality
body: <p>How can I improve the search functionality.? I have written some codes to search for something.The search was taking too much time. And the code snippets here,</p>
  
  <p>I am pulling the data from the database using this method.,</p>
  
  <pre><code>   OracleConnection connection = null;
     OraclePreparedStatement ptmst = null;
     OracleResultSet rs = null;
     OracleCallableStatement cstmt = null;
     StringBuffer strBfr = new StringBuffer();
     ArrayList myList = new ArrayList();
      try
      {     
        connection = (OracleConnection) TransactionScope.getConnection();
        strBfr.append("select distinct .......... ");  
        ptmst = (OraclePreparedStatement)connection.prepareStatement(strBfr.toString());    
        rs = (OracleResultSet)ptmst.executeQuery();           
        while (rs.next()) 
                  {               
                  HashMap hashItems = new HashMap();
                  hashItems.put("first",rs.getString(1));
                  hashItems.put("second",rs.getString(2));    
                  myList.add(hashItems);
                  }       
  
      }
      catch (Exception e) {
          }
      finally {
  
              try {
                  if (ptmst != null) {
                      ptmst.close();
                  }
              } catch (Exception e) {
              }
  
              try {
                  if (connection != null) {
                      TransactionScope.releaseConnection(connection);
                  }
              } catch (Exception e) {
              }
  
          }
          return myList; 
  </code></pre>
  
  <p>In my jsp:</p>
  
  <pre><code> ArrayList getValues = new ArrayList();     
      getValues = //calling Method here.
      for(int i=0; i &lt; getValues.size();i++)  
      {
      HashMap quoteSrch=(HashMap)allPOV.get(i);                        
      first = (String)quoteSrch.get("first");
      second = (String)quoteSrch.get("second");
      }
  </code></pre>
  
  <p>Query:</p>
  
  <pre><code>SELECT DISTINCT(mtl.segment1),
    mtl.description ,
    mtl.inventory_item_id ,
    mtl.attribute16
  FROM mtl_system_items_b mtl,
    mtl_system_items_tl k
  WHERE 1                           =1
  AND mtl.organization_id           = ?
  AND k.inventory_item_id           = mtl.inventory_item_id
  AND NVL(orderable_on_web_flag,'N')= 'Y'
  AND NVL(web_status,'UNPUBLISHED') = 'PUBLISHED'
  AND mtl.SEGMENT1 LIKE ?  --Here is the search term
  </code></pre>