How to connect to a specific circuit in H2

So, I created some schemes in H2. How to connect to a specific circuit in H2

For example, when I need to connect to a specific schema in SQL Server, I have a JDBC JDBC URL: SQLServer: // hostname: port; SelectMethod = cursor; instance_name = MySchema; DATABASENAME = DBNAME

This feature is available in H2. If not, a workaround.

I do not want to always have access to a specific table in a schema instance as MYSCHEMA.TABLE_NAME

Otherwise, I assume that the only way out will be to create the entire table in a standard schema that is publicly available

+6
source share
1 answer

This feature is supported. See this:

http://www.h2database.com/html/grammar.html#set_schema

You can specify the scheme in the connection string:

jdbc:h2:test;SCHEMA=SCHEMA_NAME 

You can also change the current scheme with:

 SET SCHEMA SCHEMA_NAME; 

Hope this helps.

+12
source

Source: https://habr.com/ru/post/982569/


All Articles