org.springframework.jdbc.UncategorizedSQLException SSH查询报错问题,急!急~急!
Spring1.2+Struts1+Hibernate3.2架构下查询报错。具体报错信息如下:org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not load an entity: [com.model.LtGrantValidate#1450]; uncategorized SQLException for SQL [SQL语句,where ltgrantval0_.id=? 将语句在SQL上运行是没问题的]SQL state [null]; error code [0]; 没有为参数号 1 设置值。; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: 没有为参数号 1 设置值。com.microsoft.sqlserver.jdbc.SQLServerException: 没有为参数号 1 设置值。 at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.buildParamTypeDefinitions(Unknown Source)出错地方是: super.getHibernateTemplate().get(LtGrantValidate.class,key);配置文件什么都没有问题。网上找了很久,看到很多类似的,但原因都不是“com.microsoft.sqlserver.jdbc.SQLServerException: 没有为参数号 1 设置值。”问下,这样的错误如何解决,出错的原因在哪?另外用到OpensessionInView。但是用super.getHibernateTemplate().find(HQL)就可以,就不报错,就是用get时候报错。这是为啥?今天下班前如果能解决,在加高分!!!!!!“没有setParameter,所以没有找到参数”---我怎么给它加setParameter? 一直都是super.getHibernateTemplate().get(LtGrantValidate.class,key);这样调用的。现在这个项目的架构不是我搭的,我这样掉就有问题。不明白,这样掉出问题的原因是啥?