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
Post a Comment