Trails with MySQL

Posted by admin

Configuring your Trails web application is really simple. By default Trails (0.6) comes configured for the built-in HSQL database. Start by modifying the context/WEB-INF/hibernate.properties file like:
hibernate.dialect=org.hibernate.dialect.MySQLDialect
hibernate.show_sql=true
hibernate.hbm2ddl.auto=update
hibernate.connection.driver_class=org.gjt.mm.mysql.Driver
hibernate.connection.url=jdbc:mysql://localhost/<dbname>
hibernate.connection.username=<dbusername>
hibernate.connection.password=<dbpassword>

replacing <db*> entries with the appropiate values for your MySQL database. Hmm, that’s it! Don’t forget to redeploy your Trails app after these changes. Also make sure the MySQL driver jar is in your TOMCAT_HOME/commons/lib directory (of course also assuming you’re using Tomcat).
Comments

Leave a response