I use the following properties file content:
driverClassName=org.apache.derby.jdbc.EmbeddedDriver
jdbcUrl=jdbc:derby:D:\\development\\databases\\test;create=true
connectionTimeout=3000
and
HikariConfig config = new HikariConfig(propertiesFilePath);
HikariDataSource ds = new HikariDataSource(config);
During
new HikariDataSource(config);
the following exception is thrown: Caused by:
java.sql.SQLTransientConnectionException: HikariPool-0 - Connection is not available, request timed out after 3002ms.
kari.pool.HikariPool.getConnection(HikariPool.java:195)
at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:147)
at com.zaxxer.hikari.pool.HikariPool.initializeConnections(HikariPool.java:510)
What I can see is that the database directories are created.
What I am doing wrong?
derby version: 10.10.1.1
HikariCP version: 2.4.3
Update
Well the solution is pretty simple. The connection timeout was just to short. If the database does not exist, the creation of the db just needs some time. After increasing the connection timeout everything works fine.