I am just trying out Hibernate Native SQL. Here is the section of my java code in my test class:
SQLQuery insurance = session.createSQLQuery(
"select * from ENTITLEMENTTYPE");
for (Iterator it = insurance.list().iterator(); it.hasNext();) {
System.out.println(it.next().toString());
}
It gives error:
SEVERE: [IBM][CLI Driver][DB2/NT] SQL0204N "ZHOUP.ENTITLEMENTTYPE" is an undefined name. SQLSTATE=42704
If I specify the correct schema name above, the error goes away. Is there a way so that I don't have to specify the schema name here????
FYI, I DO have a property set up in hibernate.cfg.xml:
<property name="hibernate.default_schema">SCI</property>
And rest of other stuff working fine for me, such as HQL.
Can anyone help? thanks
|