Connecting to a MySQL database with eRez 5
Knowledgebase #0373
eRez now contains an embedded SQL database called Apache Derby, an open source relational database implemented entirely in Java. This database can be substituted by an external SQL database.
How to connect eRez 5 to a MySQL database:
Assuming you have already installed and configured MySQL on the local system or somewhere else:
1. Create a new empty database (e.g. called "eRez") on your MySQL server.
2. Set up a user (e.g. called "eRez" with password "eRez4250") with full privileges for the new database.
3. Copy the MySQL JDBC driver (e.g. mysql-connector-java-5.0.7-bin.jar) to the [eRez installation directory]/erez5/tomcat/lib/ folder (or another place included in the Java class path for eRez).
MySQL JDBC drivers can be found here: http://dev.mysql.com/downloads/connector/j/5.1.html
4. Edit [eRez installation path]/erez5/tomcat/webapps/erez/WEB-INF/classes/META-INF/persistence.xml like this:
<property name="openjpa.ConnectionDriverName" value="com.mysql.jdbc.Driver"/>
<property name="openjpa.ConnectionUserName" value="eRez"/>
<property name="openjpa.ConnectionPassword" value="eRez4250"/>
5. Restart the eRez/Tomcat server.
6. Enjoy!