This documentation relates to uPortal 4.0
If you are using a different version, please click on "Click for all versions" on the left side of the page and select the relevant version.

Page History

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

uPortal Default Database Configuration

uPortal is configured to use a file-based HSQL database by default. This database configuration is not suitable for production deployments and best used for testing purposes.

uPortal does support a number of popular production-class databases and you can configure the database by following the examples posted under uPortal Production Database Configuration.

Step 1: Configure the Database Filter     

     1. In the filters folder, locate the default local.properties file under uPortal-4.0.x/filters/local.properties and configure the Database Connection Settings

Code Block
titleuPortal/filters/local.properties
# HSQL Configuration
environment.build.hsql.port=8887

# Database Connection Settings (Uncomment the Maven Filters section in rdbm.properties)
environment.build.hibernate.connection.driver_class=org.hsqldb.jdbc.JDBCDriver
environment.build.hibernate.connection.url=jdbc:hsqldb:hsql://localhost:${environment.build.hsql.port}/uPortal
environment.build.hibernate.connection.username=sa
environment.build.hibernate.connection.password=
environment.build.hibernate.dialect=org.hibernate.dialect.HSQLDialect
environment.build.hibernate.connection.validationQuery=select 1 from INFORMATION_SCHEMA.SYSTEM_USERS

Step 2: Deploying the database driver (4.0.x and earlier)

In addition to configuring the database connection information, changing uPortal databases also requires updating the deployed database driver.

This driver may be configured as a dependency in the main uPortal pom.xml file.

Code Block
languagehtml/xml
<jdbc.groupId>hsqldb</jdbc.groupId>
<jdbc.artifactId>hsqldb</jdbc.artifactId>
<jdbc.version>${hsqldb.version}</jdbc.version>

...
<hsqldb.version>2.2.8</hsqldb.version>

Approach 1: Add separate dependency to your chosen database (recommended)

Use this approach if you want to use HSQLDB for a local, developer database but have a different database in your shared dev/test/prod systems.

  1. Search all pom.xml files in the entire project for the string "${jdbc.groupId}" and ADD your chosen database dependency under the generic ${jdbc.groupId} dependency.  The example below uses mysql.
Code Block
<dependency>
    <groupId>${jdbc.groupId}</groupId>
    <artifactId>${jdbc.artifactId}</artifactId>
    <version>${jdbc.version}</version>
    <scope>compile</scope>
</dependency>
<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>5.1.25</version>  <!-- better: define a property <mysql.version>5.1.25</mysql.version> in the main pom.xml and reference here as <version>${mysql.version}</version> -->
</dependency>

If your installation has any non-bundled portlets (portlets not in uportal-portlets-overlay folder) that do database operations, also add the dependency to those portlet's pom.xml files.

Approach 2: Modifying the jdbc.* property values

Use this approach if you are not using HSQLDB for your local, developer database.

1. From the uPortal source directory, open the /uPortal-4.x.x/pom.xml file and add the following dependency:

 

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>5.1.25</version>
</dependency>

 

If your installation has any non-bundled portlets (portlets not in uportal-portlets-overlay folder) that do database operations, also add the dependency to those portlet's pom.xml files. 

2. Also, edit the jdbc settings in the pom.xml to replace hsqldb with your chosen database (mysql in example below).

Code Block
<jdbc.groupId>hsqldb</jdbc.groupId>
<jdbc.artifactId>hsqldb</jdbc.artifactId>
<jdbc.version>${hsqldb.version}</jdbc.version>

...
<hsqldb.version>2.2.8</hsqldb.version>

to

<jdbc.groupId>mysql</jdbc.groupId>
<jdbc.artifactId>mysql-connector-java</jdbc.artifactId>
<jdbc.version>5.1.25</jdbc.version>

 

Step 3: Testing the database configuration

To test your database configuration from the command-line:

Code Block
ant dbtest

Anchor
uPortal_Production-class_Database_Configuration
uPortal_Production-class_Database_Configuration

uPortal Production Database Configuration

Select the database below for notes and examples of configuration.

Children Display

 

Info
iconfalse
titleAdditional References
Warning
iconfalse
titleHaving problems with these instructions?

Please send us feedback at uportal-user@lists.ja-sig.org