java - In an embedded H2 database, how to prevent it from creating a database, by means of the connection URL? -


I have third-party tools that I need to know immediately that the database is false, instead of creating an empty database, Can not change, but only configure it, it does not give any wrong impression to the application that the database is with all the necessary tables, without getting any errors during the database connection. Therefore this application will fail only if it does not get the table.

I want to throw a SQLException, as the application tries to connect to a database that does not exist. For example, if the connection URL "jdbc: h2: / x / y" and the file "/x/y.h2.db" does not exist.

Is there a way to use the connection URL, to specify that the database should not be created? In other words, can the H2 driver be told the absence of data files as an error?

Is there anything like this? = & Gt; "jdbc: h2: / x / y? ifFileNotFoundThanThrowException = true"



Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -