One solution is to use:
insert into test select 1, 'Hello' from dual where not exists(select * from test where id = 1)
This should work for all databases (with the exception of the double part, you may need to create your own dummy table with one row).
To disable registration exceptions, add ;trace_level_file=0 to the database URL:
jdbc:h2:~/test;trace_level_file=0
or run the SQL statement:
set trace_level_file 0
source share