USING MYSQL IN DEVELOPMENT

These steps pertain to JumpStart 6.1.2 and later.
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.53.

  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 choice of persistence descriptor.
    • In Eclipse, edit the file build.properties, modifying the value of this property: collapsed.persistence.descriptor.
  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. apache-openejb-4.5.0-mysql-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