FHIR Chat · jpaserver datasource property after deployment · hapi

Stream: hapi

Topic: jpaserver datasource property after deployment


view this post on Zulip Gaurav Vaishnav (Mar 10 2022 at 06:09):

hi everyone ,
i am developing a terminology server using hapi-jpaserver-starter project with PostgreSQL database .
in that server i want to provide data source properties from the client input after deploying the application (may be using a UI) for that if anyone have any way to do that in hapi-jpaserver-starter please guide
thank you

view this post on Zulip Gaurav Vaishnav (Mar 11 2022 at 12:20):

hi people
can anyone guide me how can i inject data source properties(db hostname, port, username, password etc. ) to hapi-jpaserver-starter project after deploying the war file to tomcat or at runtime, depending upon the client requirement
thanku

view this post on Zulip Patrick Werner (Mar 11 2022 at 12:27):

go to your webapps folder, look for the folder created for your war, go into: WEB-INF/classes and edit the application.yaml

view this post on Zulip Joel Schneider (Mar 12 2022 at 03:02):

For Tomcat, another option is to use $CATALINA_HOME/bin/setenv.sh to define a CATALINA_OPTS environment variable, e.g.

CATALINA_OPTS="'-Dspring.datasource.url=jdbc:mysql://localhost:3306/fhir_r4?useSSL=false'"
CATALINA_OPTS="$CATALINA_OPTS -Dspring.datasource.username=myuser"
CATALINA_OPTS-"$CATALINA_OPTS -Dspring.datasource.password=secret"
CATALINA_OPTS="$CATALINA_OPTS -Dspring.datasource.driverClassName=com.mysql.cj.jdbc.Driver"
CATALINA_OPTS="$CATALINA_OPTS -Dspring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL57Dialect"
export CATALINA_OPTS

Last updated: Apr 12 2022 at 19:14 UTC