.................... String hql = "select t.fsHostip, t.fiReserve1 from Thostip as t where 1 = 1"; List ls = dao.getHibernateTemplate().find(hql); Iterator it = ls.iterator(); if(it.hasNext()){ // while 用这个的时候和下面的一样 Object[] obj = (Object[]) it.next(); String ip = (String) obj[0]; Integer rs = (Integer) obj[1]; System.out.println(ip +","+rs); } |