users@glassfish.java.net

query returning null data

From: Eve Pokua <gorgeous65_at_msn.com>
Date: Fri, 22 Jan 2010 00:23:49 +0000

 

Hello everyone,

 

I'm trying to use the following query to return data but I'm

sure if I'm on the right track -

 

public Customerent custLogin(Customerent customer)throws ShoppingException{

          Customerent customers= null;
                  
            try{
                            Query qt
                                    = em.createQuery("select c from Customerent c where c.cusid=?");
                   qt.setParameter(1, customers.getCusid());
                   return (Customerent)qt.getSingleResult();
            }catch (Exception e) {
                            logger.error("There was an error getting the customer login details. exception: " + e);
                            return customer;
                             
           }

            

        }

 

I'm not getting the results I want.

 

Thanks

 

eve
                                               
_________________________________________________________________
Send us your Hotmail stories and be featured in our newsletter
http://clk.atdmt.com/UKM/go/195013117/direct/01/