我用hibernate查询的结果想遍历。应为情况复杂所以没有用createQuery(HQL)这个函数。
而是用的createSQLQuery(SQL)这个函数。
我是这么写的:
Iterator iter = session.createSQLQuery(sql).list().iterator();
让后用while (iter.hasNext()){ Object[] tuple = (Object[]) iter.next();}然后,可以拿到每一个字段。
现象确实这样:
org.springframework.orm.hibernate3.HibernateSystemException: No Dialect mapping for JDBC type: -1; nested exception is org.hibernate.MappingException: No Dialect mapping for JDBC type: -1
求解!!!!!
如果这样遍历不行,我怎么能遍历结果???