You have to configure your DataSource.groovy file with this:
production{
pooled = false
dbCreate = "update"
jndiName = "java:comp/env/jdbc/MyGrailsDS"
}
Generate your war, place it for deployment and go configure the conf/context.xml file on your Tomcat server.
<Resource name="jdbc/MyGrailsDS" auth="Container" type="javax.sql.DataSource" username="abc" password="abc" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/my_grails_schema"/>
Start your Tomcat 7 server and enjoy. Now you can change the database your applications point at by simply changing the configuration on the context.xml file.
No hay comentarios:
Publicar un comentario