Using other database platforms

Opinio is pre installed with Hypersonic SQL - a light-weight, but fast database engine. This is meant for demonstration purpose only. To use the application in a large production environment, we recommend to change the database platform to SQL Server, MySql, Oracle or other more scalable database systems.

MySql:

  1. Install MySql, and create a database called opinio
  2. Go to the opinio/WEB-INF/database folder and log into MySql. Change database to 'opinio' and run the mysql_create.sql script:

    mysql> use opinio;

    mysql> source mysql_create.sql;

  3. Rename the file

    WEB-INF/opinio.properties

    to

    WEB-INF/HSQL_opinio.properties

  4. Then Rename the file

    WEB-INF/MySql_opinio.properties

    to

    WEB-INF/opinio.properties

  5. Edit this file (WEB-INF/opinio.properties). The line starting with

    objectplanet.persistence.jdbcURL=

    ...should read (if you have installed MySql on another system, replace localhost with the address of this host):

    jdbc:mysql://localhost:3306/opinio

    Set user name and password to use when connecting to the database:

    • objectplanet.persistence.user
    • objectplanet.persistence.password

  6. Save the changes you have made to opinio.properties
  7. Restart your web server

The connection to MySql should now work. You may also want to create your own database user (instead of using root), and set restricted permissions. To create a MySql user, look here for more information: http://www.mysql.com/doc/en/Adding_users.html. There are various admin-software on the market that makes this easier, like PhpMyAdmin (http://www.phpmyadmin.net/).

Oracle:

  1. Install Oracle, and create a database called opinio, and a user called opinio
  2. Place the Oracle JDBC driver in the Opinio/WEB-INF/lib folder. This driver should come with the Oracle installation. It is called classes12.jar.
  3. Run the script oracle_create.sql on this database, with the opinio user.
  4. Rename the file:

    WEB-INF/opinio.properties

    to

    WEB-INF/HSQL_opinio.properties

  5. Then Rename the file:

    WEB-INF/oracle_opinio.properties

    to

    WEB-INF/opinio.properties

  6. Edit this file (WEB-INF/opinio.properties). The line starting with:

    objectplanet.persistence.jdbcURL=

    ...should read (if you have installed Oracle on another system, replace localhost with the address of this host):

    jdbc:oracle:thin:@(description=(address_list=(address=(protocol=tcp)(port=1521)(host=localhost)))(connect_data=(sid=OPINIO)))

    Set user name and password to use when connecting to the database:

    • objectplanet.persistence.user
    • objectplanet.persistence.password

  7. Save the changes you have made to opinio.properties
  8. Restart your web server

Instructions for other database platforms will be added soon