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.

MSSQL with the jTDS JDBC Driver

Skip to end of metadata
Go to start of metadata
All Versions
Page not found
Table of Contents
Page not found

Not Recommended

About Microsoft SQL Server

Microsoft SQL Server (MSSQL) is a commercial database product available from Microsoft
Further technical information on this product may be found here


1. Adopters should enable the ALLOW_SNAPSHOT_ISOLATION and READ_COMMITTED_SNAPSHOT options in the portal database. Without these options, MSSQL Server will encounter deadlocks in the portlet preferences subsystem under load. You can read more about these setting here. Perform the following commands to enable these settings:



2. MSSQL Server 2005 or later: uPortal 4 starts up correctly, but the channels contain no content. SQLServer2005Dialect writes 'varchar(MAX)' where it should be 'text'. Changing the column definitions below to be 'text' fixes the problem:




3. MS SQL Server 2005 or later:  disable or delete the single uniqueness index on table UP_DLM_EVALUATOR. This index should ensure that if a fragment name is provided (is not null) then it must be unique. Unfortunately, MS SQL server is unable to provide such indexes since uniqueness check of 'null =? null' returns true when building index keys. This is not the case for other DBMS vendors (i.e. postgres).  

If you're using MS SQL 2008 or later, you can (and should) create a new filtered index to replace the deleted index in order to maintain data integrity. Here's the required SQL query:

WHERE ([fragment_name] IS NOT NULL)

Workaround above was submitted by Arvīds Grabovskis who deployed uPortal 4.0.3 at Riga Technical University, you can read his blog entry on the topic here.

Step 1: Obtaining the Driver

If using uPortal 4.0.9+, it is best to use the MS SQL Server and MS JDBC Driver (recommended) (click on link to view the instructions)


Since the jTDS JDBC driver for MSSQL is not available in the central Maven repository, it must be placed into the local repository of each machine on which you wish to build uPortal.

As an alternative to this, you could set up a maven repository for use by multiple machines.

The first step is to download the JDBC driver for your database. The preferred driver is the jTDS driver from sourceforge. It can be obtained here.

To install the JAR into your local maven repository, use the following command:

mvn install:install-file -DgroupId=net.sourceforge -DartifactId=jtds -Dversion=1.2 -Dpackaging=jar -DgeneratePom=true -Dfile=jtds-1.2.jar

The groupId, artifactId and version specified in this command are up to you, but they should match the JAR vendor, name and version to avoid confusion down the road.

Step 2: Add the Dependency

From the uPortal source directory, open the uPortal-4.x.x/pom.xml file, there is a section about 110 lines down that reads:

<!-- The JDBC Driver used by uPortal -->

Modify this to use the MSSQL driver, using the group, artifact and version information from the mvn install:install-file command above.

<!-- The JDBC Driver used by uPortal -->
<!-- Use this version if running uPortal 4.0.x on JDK 6 -->

<!-- For uPortal and up - only if running JDK 7! -->

See Issues section about possible issues using this driver.

Step 3: Configure the Database Filter     

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

# HSQL Configuration

# Database Connection Settings (Uncomment the Maven Filters section in


Step 4: Test the Configuration

Running the dbtest ant target will tell you if you have configured the database connection properly.

ant dbtest

Step 5: Build and Deploy 

Following a successful test, you can execute the command below to build the database tables and copy files to your servlet container. 

Note: Executing the command "ant clean initportal" will drop and recreate the database tables and all existing data will be lost. This will result in a clean uPortal database structure. If you want to keep the contents of your existing database, use "ant clean deploy-war"

ant clean initportal

Step 6: Restart Tomcat



Much of the information on this page was provided by Bikrant Neupane on the uportal-user list. Thanks.

Additional References

Having problems with these instructions?

Please send us feedback at

1 Comment

  1. If the SQL Server is setup to use NTLM, the connection string would be something like;domain=myDomain