USING MYSQL IN DEVELOPMENT

These steps pertain to JumpStart 5.10.1.
They enable you to develop and test in Eclipse using a MySQL database instead of HSQLDB.
They assume you have installed a MySQL database server. JumpStart has been tested with MySQL Community Server 5.1.40.

  1. Create database and user.
    Using MySQL Workbench, MySQL Query Browser, or your preferred SQL tool:
    • Log in as user root.
    • If the database is on the same machine as your development environment, then execute the following statements. Otherwise, execute the statements with your development machine's IP address instead of localhost:
      • CREATE DATABASE IF NOT EXISTS jumpstart_dev;
      • CREATE USER 'jumpstart'@'localhost' IDENTIFIED BY 'jumpstart';
      • GRANT ALL PRIVILEGES ON jumpstart_dev.* TO 'jumpstart'@'localhost';
      • FLUSH PRIVILEGES;
  2. Get the MySQL database driver.
  3. Modify the collapser to copy the appropriate persistence.xml.
    • In Eclipse, edit the file collapser.xml, commenting out the line that copies openejb-hibernate-hsqldb-persistence.xml and un-commenting the line that copies openejb-hibernate-mysql-persistence.xml.
  4. Modify the datasource configuration.
    • In Eclipse, edit the file business/src/test/conf/openejb.xml, commenting out the Resource sections involving HSQLDB and un-commenting the Resource sections involving MySQL.
    • Also modify the values of JdbcUrl, UserName, and Password to suit your MySQL database.
  5. Modify the user library.
    • In Eclipse, choose Window > Preferences > Java > Build Path > User Libraries (or in OS X, choose Eclipse > Preferences > Java > Build Path > User Libraries), and
    • Click on the existing library, eg. openejb-3.1.4-lib, then
    • Click Add Jars... and add the MySQL driver from OpenEJB's lib/ directory.
  6. Clean the project.
    • In Eclipse, choose Project > Clean. . . > jumpstart.
You now have the following environment available to Eclipse:

Web Server Business Server Persistence Database Server Logger
Jetty OpenEJB Hibernate MySQL Log4j
(As a user library) (As a user library) (As jars in project) (Provided by you) (As jars in project)













©2010, 2012 Geoff Callender, Sydney, Australia