spring hibernate .. H2 database - schema not found
The accepted answer was not fixed my problem, the working solution is to set the default schema as mentioned by Coder
<prop key="hibernate.default_schema">DOCTORASSIST</prop>
And also to initialize the creation of the schema:
<property name="hibernate.connection.url" value="jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;INIT=CREATE SCHEMA IF NOT EXISTS DOCTORASSIST"/>
As mentioned by user2180794 the parameter test
is the name of the database and not the name of the schema
Because you've have a schema name mismatch in your configuration.
This
<property name="url" value="jdbc:h2:mem:test;DB_CLOSE_DELAY=-1" />
And this
<prop key="hibernate.default_schema">DOCTORASSIST</prop>
have a conflict.
You're jdbc URL says that your working with test while your hibernate.default_schema is DOCTORASSIST, make sure both values are same.
I found the mistake. it was the connection URL.
I changed the connection URL to the following
<property name="url" value="jdbc:h2:~/test;DB_CLOSE_DELAY=-1" />
referred the documentation at this location