Hi all,
I have just migrated from informix to oracle. I use fixedString="true" by oracle driver property.
But now some hibernate queries doesn't work but if I use JdbcTemplate it works. Unfortunately I need use hibernate in some cases.If the value of this property is "true", JDBC will use FIXED CHAR semantic when setObject is called with a String argument. By default JDBC uses VARCHAR semantics. The difference is in blank padding.
Small example:
but the list is empty, inspite of I am sure that login really exists.Code:public User getUserByLogin(String login) { String queryString = "from " + User.class.getName() + " as user where user.login = ?"; HibernateTemplate temp = getHibernateTemplate(); List list = temp.find(queryString, login); return (User) list.get(0); }
If I use JdbcTemplate like this:
returned list is OK, but then I cannot easily cast result to User object.Code:String queryString = " SELECT * from gusr where login = ?"; List list = getJdbcTemplate().queryForList(queryString, new Object[] {login});
does anybody know what I am doing wrong?
thanks for your ideas


Reply With Quote