How to configure "Kitchensink Example" to use postgresql database?
You can still read and search them, but for help, please post a question on Stack Overflow.
Does anyone know what I need to add/edit to wire the "Kitchensink Example" app to use postgresql instead of default H2 that it comes with?
I have added "PostgreSQL Database 8.4" as a cartridge, but not sure what other settings I need to provide in 'persistance.xml' and in 'kitchensink-quickstart-ds.xml' files.
Here are the contents of kitchensink-quickstart-ds.xml ...
<datasource jndi-name="java:jboss/datasources/KitchensinkQuickstartDS" pool-name="kitchensink-quickstart" enabled="true" use-java-context="true"> <connection-url>postgresql://127.2.210.1:5432/myApp</connection-url> <driver-class>org.postgresql.Driver</driver-class> <security> <user-name>admin</user-name> <password>myPassword</password> </security> </datasource>
and the persistance.xml ...
<persistence-unit name="primary"> <!-- If you are running in a production environment, add a managed data source, this example data source is just for development and testing! --> <!-- The datasource is deployed as WEB-INF/kitchensink-quickstart-ds.xml, you can find it in the source at src/main/webapp/WEB-INF/kitchensink-quickstart-ds.xml --> <jta-data-source>java:jboss/datasources/KitchensinkQuickstartDS</jta-data-source> <properties> <!-- Properties for Hibernate --> <property name="hibernate.show_sql" value="true" /> </properties> </persistence-unit>
I have spent two days trying different options but they all break the app. =(