HoneyMoose
  • 首页
  • Java
  • Jersey
  • Jira
  • Confluence
  • U.S.
    • USRealEstate
    • USVisaTrack
    • H1B
  • 项目和网站
    • CWIKI.US
    • OSSEZ 社区
    • WIKI.OSSEZ.COM
    • BUG.OSSEZ.COM
    • RSS.OSSEZ.COM
BLOG.OSSEZ.COM
A responsive blog theme focused om user reading experience
  1. Home
  2. Computer Science
  3. Spring
  4. This article

Spring 数据初始 H2 后进行数据查询提示 Schema not found 错误

2020年10月22日 783Browse 2Like 0Comments

在运行测试的错误有提示下面的错误:

Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Schema "DBO" not found; SQL statement:
select myscofile0_.id as id1_1_0_, myscofile0_.dateC as datec2_1_0_, myscofile0_.dateM as datem3_1_0_, myscofile0_.uuid as uuid4_1_0_, myscofile0_.client_id as client_i5_1_0_, myscofile0_.file_name as file_nam6_1_0_, myscofile0_.file_row_count as file_row7_1_0_, myscofile0_.file_status as file_sta8_1_0_ from dbo.MYSCOFILE myscofile0_ where myscofile0_.id=? [90079-200]
	at org.h2.message.DbException.getJdbcSQLException(DbException.java:576)
	at org.h2.message.DbException.getJdbcSQLException(DbException.java:429)
	at org.h2.message.DbException.get(DbException.java:205)
	at org.h2.message.DbException.get(DbException.java:181)
	at org.h2.command.Parser.readTableFilter(Parser.java:1940)
	at org.h2.command.Parser.parseSelectFromPart(Parser.java:2827)

问题和解决

出现上面的问题是在 JPA 实例的时候配置了 schema = "dbo, 但是 H2 数据库进行初始化的时候没有创建 schema。

 

spring-h2-schema-01

 

针对上面的问题,你需要在你的 H2 初始化的时候创建一个 schema。

创建 schema 的脚本为:

CREATE SCHEMA IF NOT EXISTS DBO;
SET SCHEMA DBO;

通过添加下面的脚本,将会在 H2 中创建 Schema,然后可以通过控制台中查看创建的情况。

 

spring-h2-schema-02

 

在完成上面的配置后,再重新运行你的测试,你就会看到上面的错误已经没有错误了。

https://www.ossez.com/t/spring-h2-schema-not-found/605

Tags: None
Last updated:2020年10月22日

Kratos

stay absorbed stay excellent

Like
< Previous
Next >

Comments

Cancel reply

Newest Hotspots Random
Newest Hotspots Random
ChatGPT 的 API 调用可不太便宜 来看一个 ChatGPT 有关程序员的笑话 IntelliJ IDEA 的 Code Coverage 测试 Okhttp 如何构建一个 Get 的 URL SpringBoot 使用 @ConfigurationProperties 异常 Not registered via @EnableConfigurationProperties Jackson 的 DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES
说说这 48 小时核酸检测的时间FAA 真的应该换换系统了Java 8 使用 Stream 把 List 转换为 mapPowerShell 中运行 maven 参数无法识别1月14号的 UA857Jackson 的 DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES
Confluence 6 管理应用服务器内存设置 如何看待美国大城市已经开始进行餐馆封锁,学校关闭 Tomcat 是不是已经过气的容器 Confluence 6 MySQL 测试你的数据库连接 AWS S3 bucket 的 ACL 控制 WordPress 的站点地图地址
Categories
  • Algorithm(算法)
  • AMQP
  • Angular
  • CI
  • Compile And CI
  • Computer Science
  • Confluence
  • DataBase
  • Gradle
  • H1B
  • Hibernate
  • IDE
  • Java
  • Jersey
  • Jira
  • MariaDB
  • PrestaShop
  • Spring
  • Spring Batch
  • U.S.
  • USRealEstate
  • USVisaTrack
  • 我的小厨

COPYRIGHT © 2020 HoneyMoose. ALL RIGHTS RESERVED.

THEME CWIKIUS.CN MADE BY VTROIS