报错集锦1

  nested exception is org.hibernate.hql.ast.QuerySyntaxException:
见天搞了那么久,原来
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
		Date date = java.sql.Date.valueOf(format.format(new Date()));
		String hql = "from EmpPrivilege where employeeId = " + employee_ID
				+ "and startTime <=" + date;
 

这段代码报错是因为 form后面跟的是个完整的类名,包括package.所以应该应该改为
 
com.ymjin.po.EmpPrivilege

这样就解决了

 org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query


这个问题的解决方案很简单,主要是因为数据库中不存在相关的表或者列

你可能感兴趣的:(java,DAO,sql,Hibernate)