org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exc
来源:互联网 发布:下载神圣计划软件 编辑:程序博客网 时间:2024/05/16 12:24
org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
我的SSH项目原本使用的sqlserver2005数据库现在改用MySql。我改了applicationcontex的配置,我运行了就出现上面的异常错误!
在网上查了一下,有网友说是说没有表什么的,结果查了一下
我以为applicationcontex配置错误,改了又改,参照了又参照····没有查到什么错
我看到网友说 *.hbm.xml配置可能有问题,我就查看了下,然后再看看文档,文档配置如下:
6 <hibernate-mapping package="包名">
7 <class name="类名" table="表名">
8 <id name="主键在java类中的字段名" column="对应表中字段" type="类型 ">
9 <generator class="主键生成策略"/>
10 </id>
11
12 ……
13 </class>
14 </hibernate-mapping>
1. 主键(id)<class name="com.front.model.user.User" table="t_user" >
<!-- schema="dbo" catalog="stronger -->
而我的配置写的是:
<hibernate-mapping>
<class name="com.front.model.user.User" table="t_user" schema="dbo" catalog="stronger" >
<id name="userId" column="userId" type="java.lang.Integer">
<generator class="identity"/>
</id>
<property name="userName" column="userName" type="java.lang.String"></property>
<property name="password" column="password" type="java.lang.String"></property>
</class>
</hibernate-mapping>
于是我吧不同的schema和catalog注释了
<hibernate-mapping>
<class name="com.front.model.user.User" table="t_user" > <!-- schema="dbo" catalog="stronger -->
<id name="userId" column="userId" type="java.lang.Integer">
<generator class="identity"/>
</id>
<property name="userName" column="userName" type="java.lang.String"></property>
<property name="password" column="password" type="java.lang.String"></property>
</class>
</hibernate-mapping>
终于!弄了两天的东西终于出来了!
本人新手,遇到小问题的解决希望能对新手们有用。同时希望有人共同讨论web开发!有高手指点!
加我!!评论!!一起来学习!!
- org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exc
- org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exc
- org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exc
- [hibernate]:org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hi
- org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hibernate.exce
- org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query;
- org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query
- org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query;
- org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query
- org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query;
- ssh org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; neste
- org.springframework.dao.DataAccessResourceFailureException: could not execute query; nested exceptio
- org.springframework.dao.InvalidDataAccessResourceUsageException: Could not execute JDBC batch
- org.springframework.dao.InvalidDataAccessResourceUsageException: could not insert:
- org.springframework.dao.InvalidDataAccessResourceUsageException: could not get next sequence value
- org.springframework.dao.InvalidDataAccessResourceUsageException: could not get next sequence value
- org.springframework.dao.DataIntegrityViolationException: Could not execute JDBC batch update; nested
- org.springframework.dao.DataIntegrityViolationException: Could not execute JDBC batch update; nested
- css hack大全
- hdu ACM Steps 2.2
- 无向图割点(割顶)、桥(边的双连通分量+缩点)
- 使用PC-lint
- java泛型(二)、泛型的内部原理:类型擦除以及类型擦除带来的问题
- org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exc
- 知识产权保护案例分析----CodeMeter在刺绣机行业中的运用
- 使用HttpUrlConnection进行post 提交
- JVM之---GC内存分配
- gpio分析
- Ununtu 下安装GooglePinyin输入法
- 调用系统的裁剪功能裁剪图片
- ibatis的cacheModel
- Extjs-数据存储与传输-几种Store