Sybase SQL Server
Overview
Obtaining the Driver
Since the Sybase JDBC driver 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, 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 Sybase jConnect for JDBC product is available from Sybase at http://www.sybase.com/products/middleware/jconnectforjdbc. It is available as a download separate from the Sybase database product.
To install the JAR into your local maven repository, use the following command:
mvn install:install-file -DgroupId=com.sybase -DartifactId=sybase-jconnect -Dversion=<version> -Dpackaging=jar -DgeneratePom=true -Dfile=jconn2.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.
JAR Configuration
Opening /uPortal/pom.xml, there is a section about 110 lines down that reads:
<!-- The JDBC Driver used by uPortal --> <jdbc.groupId>hsqldb</jdbc.groupId> <jdbc.artifactId>hsqldb</jdbc.artifactId> <jdbc.version>${hsqldb.version}</jdbc.version>
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 --> <jdbc.groupId>org.sybase</jdbc.groupId> <jdbc.artifactId>sybase-jconnect</jdbc.artifactId> <jdbc.version>version</jdbc.version>
JDBC Configuration
Edit /uPortal/uportal-impl/src/main/resources/properties/rdbm.properties by adding the following information for Sybase, modifying the url, username and password as appropriate:
##### Microsoft SQL Server hibernate.connection.driver_class=com.sybase.jdbc2.SybDriver hibernate.connection.url=jdbc:sybase:Tds://localhost/uportal hibernate.connection.username=test hibernate.connection.password=mypass hibernate.dialect=org.hibernate.dialect.SybaseDialect
Testing the Configuration
Running the dbtest
ant target will tell you if you have configured the database connection properly.
ant dbtest
Then, following a successful test, you can execute
ant initportal
to build the database tables and copy files to your servlet container.