Hello.

If you want to check presence of in-memory database you can add
;IFEXISTS=TRUE
to your database URL (something like 
jdbc:h2:mem:database_name;IFEXISTS=TRUE).
With this argument an exception with error code 90013 will be thrown if 
database is not exists.

If you want to check presence of a table in an opened database you can use 
database metadata:
ResultSet rs = connection.getMetaData().getTables(null, "PUBLIC", 
"TABLE_NAME", new String[] { "TABLE" });

if (rs.next) {
…
}
or a query from INFORMATION_SCHEMA.TABLES.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to