documentation/Reference/Database Driver Reference/H2.md
{% include database-boilerplate.html %}
| Item | Details |
|---|---|
| URL format | <code>jdbc:h2:<i>file</i></code> |
| Ships with Flyway Command-line | Yes |
| Maven Central coordinates | com.h2database:h2 |
| Supported versions | 1.2.137 and later |
| Default Java class | org.h2.Driver |
/* Single line comment */
CREATE TABLE test_data (
value VARCHAR(25) NOT NULL PRIMARY KEY
);
/*
Multi-line
comment
*/
-- Sql-style comment
-- Placeholder
INSERT INTO ${tableName} (name) VALUES ('Mr. T');
INSERT INTO test_user (name) VALUES ( $$'Mr. Semicolon+Linebreak;
another line'$$);
H2 has a known RCE vulnerability that is unlikely to be fixed as it isn't enabled by default, and it is not exploitable in Flyway's use of H2.
We will update our CLI to the fixed version as soon as it becomes available, but if this is a concern you can remove the H2 dependency if you do not require it
by deleting the h2-<version> JAR from the drivers folder