Hey guys,
In the setup docs there is a segment on
modifying database connection settings, but the documentation is pretty sparse. I was hoping to get some help setting up a connection to a local Postgres database.
Disclaimer: We're a Ruby shop, with minimal knowledge of Java frameworks or tools. And this is where I think we're getting a little lost. In Genie v1 we hacked some settings in the
persistence-sql.xml file. In attempting to deploy Genie v2, we're getting stuck in the
genie-jpa.xml.In any case, if I set
CATALINA_OPTS to "
-Dspring.profiles.active=prod -Darchaius.deployment.applicationId=genie -Darchaius.deployment.environment=prod", then I believe the relevant block from
genie-jpa.xml is this one:
<beans profile="prod">
<bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://127.0.0.1/genie"/>
<property name="username" value="root"/>
<property name="password" value=""/>
<property name="minIdle" value="5"/>
<property name="maxIdle" value="20"/>
<property name="maxTotal" value="40"/>
<property name="validationQuery" value="select 0;"/>
<property name="testOnBorrow" value="true"/>
<property name="testOnCreate" value="true"/>
<property name="testWhileIdle" value="true"/>
<property name="testOnReturn" value="true"/>
<property name="minEvictableIdleTimeMillis" value="60000"/>
<property name="timeBetweenEvictionRunsMillis" value="10000"/>
</bean>
</beans>
Changing the username and password seems fairly straightforward. But I could really use an example on how to swap out these first few lines in order to properly load a PostgreSQL driver in Beans:
<bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://127.0.0.1/genie"/>
We considered just going with MySQL, but everything else we run here is Postgres. If we can easily sub in connection drivers, that would be the ideal solution. I'd appreciate any help you guys can offer.
~J