Sun Java System Portal Server 7 Community Sample Guide

Chapter 6 Open-Source Java DB

This chapter contains the following:

Introduction to Java DB

The sections contains the following:

Introduction to the Database

The Sun Java System Portal Server software uses the open-source database written in the JavaTM programming language (JavaTM DB) to store configuration and membership for the collaboration feature. The Portal Server software installs and configures the database. The Java DB runs as a standalone Java application. The Portal Server software does not manage the Java DB process; it must be manually started and stopped using the Java DB NetworkServerControl application (see Starting, Stopping, and Disabling the Java DB for more information). The database credentials are portal/portal.

Database Configuration

The Portal Server software creates a Java DB server instance at install time. A Java DB server instance is defined by a unique value for the Java DB system home directory. By default, the value is PortalServer-DataDir/derby. Whenever the Java DB server process is started, it must be passed the Java DB system home value by specifying the system property derby.system.home. The Java DB system home directory contains the database configuration, logs, and data files.

Datasource Creation

The Portal Server software components that use the Java DB access it via J2EE JDBC datasources. When a new portal instance is created, the portal software creates one JDBC datasource for each component that accesses the database. In other words, there is one datasource per component, per portal server instance.

Portal accesses the database using a JDBC datasource configured in the web container. The datasource configuration can be modified using the web container console, or command line interface. The database URL for the Java DB community database is of the form jdbc:derby://host:port/component_portal-ID. When connecting to the Java DB using third-party tools, use the driver org.apache.derby.jdbc.ClientDriver. This driver is in the JAR file /usr/share/lib/Derby/derbyclient.jar.

Starting, Stopping, and Disabling the Java DB

This section contains the following:

ProcedureTo Start and Stop Java DB

For more information, see http://db.apache.org/derby/javadoc/publishedapi/org/apache/derby/drda/NetworkServerControl.html and http://db.apache.org/derby/docs/10.0/manuals/admin/hubprnt14.html#HDRCBDJHHFD.

Step

    The database can be stopped and started using the Java DB NetworkServerControl class.

    For example, type:

    • java -Dderby.system.home=PortalServer-DataDir/derby org.apache.derby.drda.NetworkServerControl start to start the database.

    • java -Dderby.system.home=PortalServer-DataDir/derby org.apache.derby.drda.NetworkServerControl shutdown to stop the database.


    Note –

    To run this command:

    • The derby.jar, derbytools.jar, and derbynet.jar files must be in your classpath. By default, these JAR files are installed into /usr/share/lib/Derby directory.

    • The system property Dderby.system.home must be set to PortalServer-DataDir/derby.


ProcedureTo Disable Java DB

Steps
  1. Log in to the Portal Server host as root and go to PortalServer-DataDir/portals/portal-ID/config/ directory.

  2. Edit the communitymc.properties file and remove the jdo entry from the manager.contributors list to disable Java DB.

    See communitymc.properties File list for more information on this file and its contents. Note that if this change is applied, the community sample will not function properly.