谁来救救我谢谢关于SSH的
我是这样调用的
public static void main(String[] args) {
AbstractApplicationContext context = AppContext.getInstace()
.getAppContext();
OrderDAO dao = (OrderDAO) context.getBean("orderService");
java.util.List list = dao.getOrderDetails();
System.out.println(list.size());
}
方法是这样实现的
public List getOrderDetails() {
// TODO 自动生成方法存根
hql = "from Orderdetail";
// list =
// this.getHibernateTemplate().loadAll(Orderdetail.class);
list = this.getHibernateTemplate().find(hql);
System.out.println(list.size() + ">>>size");
if (list.size() > 0) {
return list;
}
return null;
}
Hibernate: select orderdetai0_.id as id2_, orderdetai0_.bid as bid2_, orderdetai0_.oid as
oid2_, orderdetai0_.orderprice as orderprice2_, orderdetai0_.number as number2_ from
bookStoreBusiness.dbo.orderdetail orderdetai0_
org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not execute
query; uncategorized SQLException for SQL [select orderdetai0_.id as id2_, orderdetai0_.bid
as bid2_, orderdetai0_.oid as oid2_, orderdetai0_.orderprice as orderprice2_,
orderdetai0_.number as number2_ from bookStoreBusiness.dbo.orderdetail orderdetai0_]; SQL
state [HY000]; error code [0]; [Microsoft][SQLServer 2000 Driver for JDBC]Value can not be
converted to requested type.; nested exception is java.sql.SQLException: [Microsoft]
[SQLServer 2000 Driver for JDBC]Value can not be converted to requested type.
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Value can not be converted
to requested type.
谁看得懂这个异常
主要原因好象是这个Value can not be converted to requested type.