← Back to team overview

dhis2-devs team mailing list archive

Re: dhis lite

 

>
> Or maybe jdbc:h2:./database/dhis2 (see the little dot - to make the
> url relative).


You are right again.


>  I think I'd still use a hibernate.properties file,
> probably alongside the jar, to allow some flexibility.  Still have to
> puzzle how best to deal with the DHIS2_HOME env variable.  I don't
> think Java has a native setEnv() or getCwd() which would have been
> useful.
>
> >keep the hardcoded "webapp" folder in WebAppServer
> slightly different as webapp would now point to directory resource
> outside of the jar, but yes, still some hardcoded default.
>
> Alternatively (maybe this is better) have a dhis2config.xml file
> inline with the jar ...
>

What do you think about simply reading in the hibernate.properties file with
a FileInputStream from the executable JAR? A FileInputStreamwill look in the
current folder if you pass just a filename as parameter, something like:

Properties props = new Properties();
props.load( new FileInputStream( "hibernate.properties" ) );

References