title: Null Pointer Exception in Servlet
body: <p>I'm having a rather annoying issue with a shopping servlet I'm designing. I keep getting a null pointer exception when I try setting up an order object like this:</p>
  
  <pre><code>           int ccn=customer.getCcn();
              OrderList.Order order=null;
      ResultSet set=helper.selectOrder(custId);
      try{
          while (set.next()){
              orderno=set.getInt(1);
              orderDate=set.getString(2);
              shipDate=set.getString(3);
              custId=set.getString(4);
              order=list.new Order(orderno,custId,ccn);
              list.addOrder(order);
  
          }
          set.close();}
          catch(Exception e){
              System.out.println(e.getMessage());
          }
  </code></pre>
  
  <p>But if I do this, the exception goes away... but my list is full of duplicates.</p>
  
  <pre><code>            int ccn=customer.getCcn();
      ResultSet set=helper.selectOrder(custId);
      try{
          while (set.next()){
              orderno=set.getInt(1);
              orderDate=set.getString(2);
              shipDate=set.getString(3);
              custId=set.getString(4);
          }
          set.close();}
                      OrderList.Order order=list.new Order(orderno,custId,ccn);
                      list.addOrder(order);
          catch(Exception e){
              System.out.println(e.getMessage());
          }
  </code></pre>
  
  <p>Any help?</p>