This documentation relates to an earlier version of Bamboo.
View

Unknown macro: {spacejump}

or visit the current documentation home.

These instructions will help you connect Bamboo to a PostgreSQL 8.2+ database.
(PostgreSQL 8.0 and PostgreSQL 8.1 are not supported for use with Bamboo.)

(info) Please note, the JDBC driver for PostgreSQL 8.2 (PostgreSQL Driver 8.4.x) is bundled with Bamboo. You do not have to download and install the driver.

1. Configuring PostgreSQL

リモート TCP 接続を承認する (リモート PostgreSQL サーバーのみ)

If you are connecting Bamboo to a remote PostgreSQL server (i.e. if your PostgreSQL server is not installed locally on your Bamboo server host system), you will need to configure your data/postgresql.conf and data/pg_hba.conf files to accept remote TCP connections from your Bamboo server's IP address.

The following PostgreSQL documentation contains information on the appropriate listen_addresses value in the postgresql.conf file as well as the pg_hba.conf file:

Once you have modified your data/postgresql.conf and data/pg_hba.conf files, you will need to restart PostgreSQL for your changes to take effect.

Creating a Bamboo database

sudo -s -H -u postgres
# Create the Bamboo user:
/opt/PostgreSQL/8.3/bin/createuser -S -d -r -P -E bamboouser
# Create the bamboo database:
/opt/PostgreSQL/8.3/bin/createdb -O bamboouser bamboo
exit

Creating a completely empty bamboo database is recommended. Avoid using templates to create the database as some may insert default tables which can lead to conflicts when setting up Bamboo.

2. Connecting Bamboo to PostgreSQL

Bamboo provides two ways to connect to a PostgreSQL database — via JDBC or via a datasource. JDBC is generally simpler and is the recommended method.

Connecting via JBDC

To connect Bamboo to a PostgreSQL database, via JDBC,

  1. Run the Setup Wizard and choose the 'Custom Installation' method.
  2. On the Choose a Database Configuration page, choose 'External Database', select 'PostgreSQL 8.2 and above' from the list and click the 'Continue' button. The Database Configuration page appears.
  3. Ensure that 'Direct JDBC connection' has been chosen and complete the following fields (as shown in the screenshot below):
    • 'Driver Class Name' — Type the following: org.postgresql.Driver (if different from the default).
    • 'Database URL' — Type the URL where Bamboo will access your database (if different from the default). For details about syntax, please refer to the Postgres JDBC driver documentation.
    • '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.
  4. Select the 'Overwrite existing data' check box if you wish Bamboo to overwrite any tables that already exist in the database.
  5. Click 'Continue' to finish specifying your connection settings.

Screenshot 1: 'Setup JDBC Connection (PostgreSQL)'

Connecting via a datasource

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

  1. Configure a datasource in your application server (consult your application server documentation for details).
    (info) For details about the syntax to use for the JDBC database URL, please see the Postgres JDBC driver documentation.
  2. Run the Setup Wizard and choose the 'Custom Installation' method.
  3. On the Choose a Database Configuration page, choose 'External Database', select 'PostgreSQL 8.2 and above' from the list and click the 'Continue' button. The Database Configuration page appears.
  4. Choose 'Connect via a datasource (configured in the application server)' (as shown in the screenshot below).
  5. In the 'JNDI name' field, type the JNDI name of your datasource, as configured in your application server.
    (warning) If java:comp/env/jdbc/DataSourceName does not work, try jdbc/DataSourceName (and vice versa).
  6. Select the 'Overwrite existing data' check box if you wish Bamboo to overwrite any tables that already exist in the database.
  7. Click 'Continue' to finish specifying your connection settings.

Screenshot 2: 'Setup Datasource Connection'