Issue
I have an error when using url for in memory h2 database. Following format for url property is used:
spring:
datasource:
username: sa
url: jdbc:h2:mem:master;MODE=MSSQLServer;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=FALSE;DB_CLOSE_ON_EXIT=false;CASE_INSENSITIVE_IDENTIFIERS=TRUE;TRACE_LEVEL_SYSTEM_OUT=2;INIT=CREATE SCHEMA IF NOT EXISTS dbo\\;SET SCHEMA dbo;
but for some reason the error indicates that the format is not correct:
org.h2.jdbc.JdbcSQLNonTransientConnectionException: URL format error; must be "jdbc:h2:{ {.|mem:}[name] | [file:]fileName | {tcp|ssl}:[//]server[:port][,server2[:port]]/name }[;key=value...]" but is "jdbc:h2:mem:master" [90046-200]
I also tried replacing \\;SET SCHEMA dbo;
with SCHEMA=dbo
but it does not seem to find the dbo schema in this case.
Any suggestions are appreciated. Thanks!
Solution
You need to replace \\;
with \;
before SET SCHEMA
.
Answered By - Evgenij Ryazanov
Answer Checked By - Marie Seifert (JavaFixing Admin)