解决办法参考:
https://blog.youkuaiyun.com/deniro_li/article/details/80799947
下面是配置文件中连接数据库的信息,且已经成功连接。并且表存在,但是是跟mysql创建表时一样:表名和字段名均是小写
spring.datasource.oracle.jdbc-url=jdbc:oracle:thin:@localhost:1521:orcl spring.datasource.oracle.username=ZMX spring.datasource.oracle.password=zmx spring.datasource.oracle.driver-class-name=oracle.jdbc.driver.OracleDriver spring.datasource.oracle.maximum-pool-size=5
控制台一直报如下错误:
2020-04-24 20:56:21.642 ERROR 23432 --- [nio-8083-exec-1] o.h.engine.jdbc.spi.SqlExceptionHelper : ORA-00942: 表或视图不存在
2020-04-24 20:56:21.651 ERROR 23432 --- [nio-8083-exec-1] c.e.e.controller.VIPGroupController : 出现异常:could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet
将表名和字段都改为大写之后,就不报错了
Hibernate: select customgrou0_.id as id1_0_, customgrou0_.group_id as group_id2_0_, customgrou0_.group_name as group_na3_0_, customgrou0_.phone as phone4_0_, customgrou0_.type as type5_0_ from custom_group customgrou0_ where customgrou0_.type=?
当遇到Oracle错误'ORA-00942: 表或视图不存在'时,问题可能出在表名和字段名的大小写上。尽管配置文件已成功连接数据库且表实际存在,但控制台仍显示错误。将表名和字段名全部转换为大写后,错误消除。参考链接提供了解决此类问题的详情。
5805

被折叠的 条评论
为什么被折叠?



