This page last changed on Oct 16, 2008 by alui.
Before you begin
Please ensure that your MySQL database server is set to 'utf8' character encoding, and not 'latin1' character encoding. For details please see:

First, you need to choose how you will connect to the MySQL database. Please follow the instructions for your chosen method:

JDBC is generally simpler, and is therefore the recommended method.


Connecting via JDBC


To connect Bamboo to a MySQL database, via JDBC,

  1. Put the MySQL JDBC driver jar file (download here) into your application server's classpath:
    • For the Bamboo Standalone distribution, copy the jar file into the webapp/WEB-INF/lib directory.
    • For the Bamboo EAR-WAR distribution, the location will depend on which application server you are using.
  2. At Step 2 of the Bamboo Setup Wizard, choose 'External Database' and select 'MySQL' from the list.
  3. The 'Select Database Connection' screen will appear. Select 'Direct JDBC connection'.
  4. The 'Setup JDBC Connection' screen will appear as shown in the screenshot below.
    • 'Driver Class Name' — Type the following: com.mysql.jdbc.Driver
    • 'Database URL' — Type the URL where Bamboo will access your database. For syntax, please see the MySQL documentation.
      Include the autoReconnect=true flag, the useUnicode=true flag and the characterEncoding=utf8 flag, e.g.:
          jdbc:mysql://localhost/bamboo?autoReconnect=true&useUnicode=true&characterEncoding=utf8
      If the autoReconnect flag is not set, the MySQL JDBC driver will eventually time out and Bamboo will no longer be able to communicate with the database.
    • 'User Name' — Type the username that Bamboo will use to access your database.
    • 'Password' — Type the password (if required) that Bamboo will use to access your database.
  5. Select the 'Overwrite existing data' checkbox if you wish Bamboo to overwrite any tables that already exist in the database.
  6. Go to Step 3 of the Setup Wizard.

Screenshot 1: 'Setup JDBC Connection (MySQL)'



Connecting via a datasource


To connect Bamboo to a MySQL database, via a datasource,

  1. Configure a datasource in your application server (consult your application server documentation for details). For the syntax of the JDBC URL to use, please see the MySQL documentation.
    In the JDBC URL that you configure in your application server, include the autoReconnect=true flag, the useUnicode=true flag and the characterEncoding=utf8 flag, e.g.:
        jdbc:mysql://localhost/bamboo?autoReconnect=true&useUnicode=true&characterEncoding=utf8
    If the autoReconnect flag is not set, the MySQL JDBC driver will eventually time out and Bamboo will no longer be able to communicate with the database.
  2. At Step 2 of the Bamboo Setup Wizard, choose 'External Database' and select 'MySQL' from the list.
  3. The 'Select Database Connection' screen will appear. Select 'Connect via a datasource (configured in the application server)'.
  4. The 'Setup Datasource Connection' screen will appear as shown in the screenshot below. In the 'JNDI name' field, type the JNDI name of your datasource, as configured in your application server.
    If java:comp/env/jdbc/DataSourceName doesn't work, try jdbc/DataSourceName (and vice versa).
  5. Select the 'Overwrite existing data' checkbox if you wish Bamboo to overwrite any tables that already exist in the database.
  6. Go to Step 3 of the Setup Wizard.

Screenshot 2: 'Setup Datasource Connection'




Document generated by Confluence on Mar 09, 2009 17:06