Sun GlassFish Web Space Server 10.0 Administration Guide

ProcedureTo Connect to a Database Other Than HSQL

You need to make changes to the JDBC property in portal-ext.properties only when you are installing Web Space Server on GlassFish Enterprise Edition. It is not necessary to make these changes, when you are installing Web Space Server on the GlassFish JAR based installer.

  1. Create a temporary folder. In this example, the folder is named test.

    mkdir /tmp/test

  2. Copy the portal-impl.jar file to the tmp folder.

    The portal-impl.jar file contains resource bundles for Web Space Server.

    cd GlassFish-install-dir/domains/domain1/application/j2ee-modules

    cp webspace/WEB-INF/lib/portal-impl.jar /tmp/test

  3. Change to the tmp directory.

    cd /tmp/test

  4. Extract the portal-impl.jar file.

    jar -xvf portal-impl.jar

    The portal.properties file will be placed in the tmp directory.

  5. Open the portal.properties file and copy the JDBC property.

  6. Create a text file named portal-ext.properties, and paste the JDBCproperty into it.

    The Hypersonic (HSQL) and MySQL part of the JDBC property looks as below:

    #
        # Hypersonic
        #
        jdbc.default.driverClassName=org.hsqldb.jdbcDriver
        jdbc.default.url=jdbc:hsqldb:lportal
        jdbc.default.username=sa
        jdbc.default.password=
    
        #
        # MySQL
        #
        #jdbc.default.driverClassName=com.mysql.jdbc.Driver
        #jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=
    UTF-8&useFastDateParsing=false
        #jdbc.default.username=
        #jdbc.default.password=
  7. Comment Hypersonic (HSQL) and uncomment MySQL.


    Note –

    Properties in the portal properties file are commented using the hash (#) symbol. A property can be commented by placing a hash symbol in front of it.


  8. Save the portal-ext.properties file.

  9. Create a directory structure webspace/WEB-INF/classes/ under ZIP_ROOT/webspace-for-gfv2/var/webspace/war-workspace/customs, and copy portal-ext.properties file to it.

  10. Change directory to ZIP_ROOT/webspace-for-gfv2/var/webspace/war-workspace.

    cd ZIP_ROOT/webspace-for-gfv2/var/webspace/war-workspace

  11. Run ant -f synchronize.xml.

  12. Restart the GlassFish server.

    The server will redeploy websynergy.war and update portal-ext.properties under applications/j2ee-modules/webspace/WEB-INF/classes.