I am using hibernate 3.3 to access DB2 tables. When we upgraded to DB2 9.7.2 on Linux last week, we found we had to modify some of our hibernate SQL queries in order to be compatible with DB2 9.7.2. With DB2 9.7.1 our hibernate SQL worked fine, but with DB2 9.7.2 we receive the SQL -401 SQLSTATE 42818 error with certain queries.
Below is the hibernate SQL before we modified it for DB2 9.7.2:
Query query = session.createQuery("from ACSystem s where s.systemnm=:searchstring"); query = query.setString("searchstring", name); List list = query.list(); Iterator results =list.iterator();
After changing the code as follows, then it worked with DB2 9.7.2:
String querystring = "from ACSystem s where s.systemnm='" + name + "'";
Iterator results = session.createQuery(querystring).list().iterator();
Has anyone run into this?
|