org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not execute query; uncategorized SQLException for SQL [select userinfo0_.id as id0_, userinfo0_.name as name0_, userinfo0_.password as password0_, userinfo0_.datetim as datetim0_, userinfo0_.uname as uname0_, userinfo0_.visible as visible0_ from userinfo userinfo0_ where userinfo0_.id=?]; SQL state [S1009]; error code [0]; Invalid value for getInt()
你给那个?赋值了么?
String [] paramNames = new String[]{"name","password"};
Object [] values = new Object[]{name,password};
user = (UserInfo)hibernateTemplate.findByNamedPar(hql,paramNames,values).get(0);
String hql = "from UserInfo u where u.id=:id" ;
user = (UserInfo) hibernateTemplate.findByNamedParam(hql, "id", id);