I am trying to connect Netbeans' iReport plugin with my HSQLDB database so i can build my report against its data. My JavaFX application is Spring-Boot based and perfectly happily uses the following connection string :
jdbc:hsqldb:db/TFH
I use an environment variable set to the path of my working directory for things such as the Spring application.properties file, like this :
@PropertySource("file:${TFH_HOME}/config.properties")
My issue is that iReport can't use the same connection string because it literally looks for the db folder in the Netbeans install directory. My idea would be to put the environment variable in the JDBC connection string directly but i can't seem to get this working. I have looked around for the right syntax but nothing seems to work. I tried this :
jdbc:hsqldb:${TFH_HOME}/db/TFH
This makes iReport literally search for the DB file in this non-existent folder :
C:\Program Files\NetBeans 8.2\${TFH_HOME}\db\
How can you make a JDBC URL include an environment variable and make it search for the DB in a relative path?
Thanks!
HSLQDB supports variables defined for Java in this context. So if you define your TFH_HOME as part of your Java command, it will be picked up when the JDBC URL is processed.