Stream: social
Topic: hapi-fhir
Justin Marsh (Feb 19 2017 at 22:59):
Hello new friends! I'm trying to get a hapi-fhir setup and hooked up to an existing mysql database, but I'm new to Maven, Tomcat, and the whole build process around how they work. Anyone have some experience here?
Lloyd McKenzie (Feb 20 2017 at 06:08):
You might want to check out the hapi stream (https://chat.fhir.org/#narrow/stream/hapi)
Justin Marsh (Feb 21 2017 at 00:24):
Excellent, thanks for the pointer in the right direction.
Peter Hendriks (Mar 06 2017 at 13:39):
Hi Justin,
I did just that for the http://hapi.simplifier.net hapi-fhir implementation. I used the JPAServerDemo from from Maven and modified the DataSource in FhirServerConfig class so that it would look for MySQL instead of Derby: @Bean(destroyMethod = "close")
public DataSource dataSource()
{
BasicDataSource retVal = new BasicDataSource();
//retVal.setDriver(new org.apache.derby.jdbc.EmbeddedDriver());
//retVal.setUrl("jdbc:derby:directory:target/jpaserver_derby_files;create=true");
try
{
retVal.setDriver(new com.mysql.jdbc.Driver());
retVal.setUrl("jdbc:mysql://localhost:3306/db_hapi");
} catch (Exception e)
{
e.printStackTrace(System.out);
}
retVal.setUsername("myusername");
retVal.setPassword("mypassword");
return retVal;
}
Don't forget to register the MySQL libraries in your POM.
Last updated: Apr 12 2022 at 19:14 UTC