hibernate异常:could not extract ResultSet
来源:互联网 发布:mac os 10.12 iso下载 编辑:程序博客网 时间:2024/05/19 20:43
环境说明
SSH:Struts2 + Spring4 + hinernate5
数据库: Oracle12c
具体问题
实现一个登陆功能时,报错如下:
解决方案
错误显示表或者视图不存在,应该是hibernate映射文件出现问题,查看hibernate.hbm.xml如下
<hibernate-mapping> <class name="edu.fjnu.logistics.domain.User" table="t_user"> <id name="id" type="java.lang.Integer"> <column name="id" length="32" /> <generator class="sequence"> <param name="sequence">SEQ_USER</param> </generator> </id>后面省略...
其中class的属性table=”t_user”,使用SQL Devloper查看数据库名称,猜想可能是双引号在作怪,如下
于是把双引号去除,数据库名称变为了大写,同时修改hibernate.hbm.xml的class属性table=”T_USER”,重启服务器,发现还是报错,但是错误已经改变了,变为
java.sql.SQLSyntaxErrorException: ORA-00904: “USER0_”.”PASSWORD”: 标识符无效
还是同样原因,oracle字段名称如下
将引号去掉,重启服务器即可成功实现登陆功能。
总结
数据库的建表语句是根据powerdesigner导出的,而DBMS最高只能选择Oracle11g的并没有Oracle12c的,具体的建表语句里面加了引号,如下
/*==============================================================*//* DBMS name: ORACLE Version 11g *//* Created on: 2017/11/14 14:45:19 *//*==============================================================*/drop table "t_user" cascade constraints;/*==============================================================*//* Table: "t_user" *//*==============================================================*/create table "t_user" ( "id" VARCHAR2(32) not null, "username" VARCHAR2(20) not null, "password" VARCHAR2(32) not null, "salary" BINARY_DOUBLE, "birthday" DATE, "gender" VARCHAR2(10), "station" VARCHAR2(40), "telephone" VARCHAR2(11), "remark" VARCHAR2(255), constraint PK_T_USER primary key ("id"));
数据库中引号的细微差别导致的错误,真心是个坑。
阅读全文
0 0
- hibernate异常:could not extract ResultSet
- could not extract ResultSet
- could not extract ResultSet
- Hibernate抛出异常org.hibernate.exception.SQLGrammarException: could not extract ResultSet
- SQLGrammarException: could not extract ResultSet
- org.hibernate.exception.SQLGrammarException: could not extract ResultSet
- org.hibernate.exception.SQLGrammarException: could not extract ResultSet
- org.hibernate.exception.SQLGrammarException: could not extract ResultSet
- org.hibernate.exception.SQLGrammarException: could not extract ResultSet
- sql中could not extract ResultSet 问题~
- org.hibernate.exception.SQLGrammarException: could not extract ResultSet at org.hibernate.exception.
- Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet 报错原因
- RestClientException: Could not extract response:
- Hibernate operation: could not insert异常
- hibernate.exception.SQLGrammarException异常:could not insert、
- hibernate 异常:could not locate named parameter
- hibernate出现异常org.hibernate.exception.SQLGrammarException:could not execute
- hibernate 报 org.hibernate.type.SerializationException:could not deserialize 异常
- 统计学习方法---感知机算法实现代码
- Android多点触控
- jQuery()方法构建原理
- java通过rest调用php暴露的接口,同一字段可能为false或List,反序列化报错
- 腐蚀与膨胀(Eroding and Dilating)
- hibernate异常:could not extract ResultSet
- python中all()和any()的区别
- React render props
- PHP CURL获取cookies模拟登录…
- nginx部署项目
- 文件上传类demo
- C与C++互相调用的方法
- 如何处理大量数据高并发大流量并发操作方案
- 小程序获取网络状态