Default Database

The default database distributed with Jetspeed-2 is the Apache Derby database. To move on to a more robust database, follow the instructions in the next section.

Supported Databases

List of supported databases:

Database NameBuild ConstantTested Versions
IBM DB2db29.1
Apache Derby, IBM Cloudscapederby10.1
Hypersonic SQL (HSQL)hsql1.8
Microsoft SQL Servermssql2000, 2005
MySQLmysql4.*, 5.*
Oracleoracle9i, 10g
PostgreSQLpostgres8.*
SAP DB, MaxDBsapdb7.5

MySQL

To run with My SQL, add the following properties to your $HOME/build.properties:

				

# -------------------------------------------------------------------------
# configure MySQL Test DB (only needed when running unit tests)
# -------------------------------------------------------------------------
org.apache.jetspeed.test.database.default.name=mysql
org.apache.jetspeed.test.database.url = jdbc:mysql://j2-server/j2test
org.apache.jetspeed.test.database.driver = com.mysql.jdbc.Driver
org.apache.jetspeed.test.database.user = jetspeed2
org.apache.jetspeed.test.database.password = whatever
# -------------------------------------------------------------------------
# configure MySQL Production DB
# -------------------------------------------------------------------------
org.apache.jetspeed.production.database.default.name=mysql
org.apache.jetspeed.production.database.url = jdbc:mysql://j2-server/j2
org.apache.jetspeed.production.database.driver = com.mysql.jdbc.Driver
org.apache.jetspeed.production.database.user = jetspeed2
org.apache.jetspeed.production.database.password = whatever
# -------------------------------------------------------------------------


			

In the example above, you will need to have a MySQL server running on a host named 'j2-server' with a database called 'j2' for production.

If you are going to run the unit tests you will also need an additional test database called 'j2test'.

A user named 'jetspeed2' should be granted access to both the 'j2' and 'j2test' databases.

MySQL Known Issues

None

Oracle

To run with Oracle, add the following properties to your $HOME/build.properties:

				

# -------------------------------------------------------------------------
# configure Oracle Test DB (only needed when running unit tests)
# -------------------------------------------------------------------------
# org.apache.jetspeed.test.database.default.name=oracle
# org.apache.jetspeed.test.database.ojb.platform=oracle9i
# org.apache.jetspeed.test.database.url = jdbc:oracle:thin:@j2-sever:1521:j2db
# org.apache.jetspeed.test.database.driver = oracle.jdbc.driver.OracleDriver
# org.apache.jetspeed.test.database.user = j2test
# org.apache.jetspeed.test.database.password = whatever
# -------------------------------------------------------------------------
# configure Oracle Production DB
# -------------------------------------------------------------------------
# org.apache.jetspeed.production.database.default.name=oracle
# org.apache.jetspeed.production.database.ojb.platform=oracle9i
# org.apache.jetspeed.production.database.url = jdbc:oracle:thin:@j2-server:1521:j2db
# org.apache.jetspeed.production.database.driver = oracle.jdbc.driver.OracleDriver
# org.apache.jetspeed.production.database.user = j2
# org.apache.jetspeed.production.database.password = whatever
# -------------------------------------------------------------------------


			

In the example above, you will need to have a Oracle server running on a host named 'j2-server' and have an Oracle database SID named 'j2db' installed on that server. Also, you will need a database user (schema) called 'j2' for production usage.

If you are going to run the unit tests you will need an additional user called 'j2test'.

Oracle Known Issues

Only for the first time you create the database for Oracle, there is an issue with the drop statements. To get around this problem, set your properties as above in your $HOME/build.properties, and then run these commands using the Jetspeed 2 Maven plugin :

					

maven j2:db.scripts.gen
maven j2:dropdrops
maven j2:db.create.test (only when running unit tests)
maven j2:db.create.production


				

Drivers

JDBC drivers are configured to work with the Maven build by adding your specified JDBC driver jars to the Maven class path. Specify the jars with the org.apache.jetspeed.test.jdbc.drivers.path and org.apache.jetspeed.production.jdbc.drivers.path properties in your $HOME/build.properties.

NOTE: The Derby JDBC driver is distributed with Jetspeed and require no configuration.

				

# My SQL Driver Path Example, test and production
org.apache.jetspeed.test.jdbc.drivers.path=
     /Portal/lib/MySQL/mysql-connector-java-3.0.8-stable-bin.jar
org.apache.jetspeed.production.jdbc.drivers.path=
     /Portal/lib/MySQL/mysql-connector-java-3.0.8-stable-bin.jar

# Oracle 9i Driver Path Example, test and production
org.apache.jetspeed.test.jdbc.drivers.path=
     /Portal/lib/oracle/ojdbc14.jar;/Portal/lib/oracle/nls_charset12.jar
org.apache.jetspeed.production.jdbc.drivers.path=
     /Portal/lib/oracle/ojdbc14.jar;/Portal/lib/oracle/nls_charset12.jar

# Oracle 8i Driver Path Example, test and production
org.apache.jetspeed.test.jdbc.drivers.path=
     /Portal/lib/oracle/classes12.jar;
org.apache.jetspeed.production.jdbc.drivers.path=
     /Portal/lib/oracle/classes12.jar;


			

Distributing Drivers

When Jetspeed is deployed to an application server using the maven deploy target, only the Derby JDBC driver is copied into the web application. To distribute a specific driver (i.e. Oracle, MySQL), you will need to copy the driver into the application server's common class path for shared code.

Application ServerProcedure
Tomcat 5 and 5.5 copy driver(s) to ${TOMCAT_HOME}/endorsed/

Datasource Configuration with Jetspeed-2

Jetspeed-2 requires a datasource to be configured in the application server on which it is being deployed. For more information, see the RDBMS component documentation.