Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Get h2 compatibility mode of current connection

In H2 I can set the compatibility mode for a connection:

SET MODE DB2;

Is there a way to query the mode like:

GET MODE;

For the current schema I can do select schema() but select mode() will not work. Any suggestions?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

With H2 1.*.* use

SELECT `VALUE` FROM INFORMATION_SCHEMA.SETTINGS WHERE NAME = 'MODE';

With H2 2.*.* use

SELECT SETTING_VALUE FROM INFORMATION_SCHEMA.SETTINGS WHERE SETTING_NAME = 'MODE';

Use upper-case names of tables and columns in these queries for more safety, H2 has really weird settings for case conversion and sensitivity and some applications may enable them.

If old information schema was enabled in H2 2.*.* with a special setting or because old driver was used for remote connection to a new server, use variant for H2 1.*.*.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading