Sakai Database Property Settings

Sakai database property settings are stored in sakai.properties and placeholder.properties. Both files are located by default in tomcat/sakai.

Every sakai.properties MUST HAVE these settings:

# sakai.properties

## Placeholder properties : the complete set must be defined here 

# set the hibernate dialect (for shared datasource) 
hibernate.dialect=net.sf.hibernate.dialect.HSQLDialect 

#set the auto DDL feature 
auto.ddl=true 

This is due to a "bug" in Spring's placeholder system that we will address later.

Then you need some more stuff:

  1. set the hibernate dialect (for shared datasource), HSQLDB by default, mySql and Oracle examples
  2. NOTE: this is required, and must be in any sakai.properties file
    hibernate.dialect=net.sf.hibernate.dialect.HSQLDialect
    #hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect
    #hibernate.dialect=net.sf.hibernate.dialect.Oracle9Dialect
  1. set the shared datasource driver, HSQLDB by default, mySql and Oracle examples
    driverClassName@javax.sql.DataSource=org.hsqldb.jdbcDriver
    #driverClassName@javax.sql.DataSource=com.mysql.jdbc.Driver
    #driverClassName@javax.sql.DataSource=oracle.jdbc.driver.OracleDriver
  1. set the shared datasource URL, HSQLDB in-memory by default, mySql and Oracle examples
    url@javax.sql.DataSource=jdbc:hsqldb:.
    #url@javax.sql.DataSource=jdbc:mysql://127.0.0.1:3306/sakai?useUnicode=true&characterEncoding=UTF-8
    #url@javax.sql.DataSource=jdbc:oracle:thin:@monster.oracle.org:1521:db
  1. set the vendor for legacy sql access
    vendor@org.sakaiproject.service.framework.sql.SqlService=hsqldb
    #vendor@org.sakaiproject.service.framework.sql.SqlService=mysql
    #vendor@org.sakaiproject.service.framework.sql.SqlService=oracle

And:

username@javax.sql.DataSource=
password@javax.sql.DataSource=

MySQL (sakai.properties)

auto.ddl=true 
hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect 
vendor@org.sakaiproject.service.framework.sql.SqlService=mysql 
driverClassName@javax.sql.DataSource=com.mysql.jdbc.Driver 
url@javax.sql.DataSource=jdbc:mysql://127.0.0.1:3306/sakai?useUnicode=true&characterEncoding=UTF-8 
username@javax.sql.DataSource=sakai 
password@javax.sql.DataSource=rocks 

Oracle (sakai.properties)

auto.ddl=true 
hibernate.dialect=net.sf.hibernate.dialect.Oracle9Dialect 
vendor@org.sakaiproject.service.framework.sql.SqlService=oracle 
driverClassName@javax.sql.DataSource=oracle.jdbc.driver.OracleDriver 
url@javax.sql.DataSource=jdbc:oracle:thin:@monster.oracle.org:1521:db 
username@javax.sql.DataSource=sakai 
password@javax.sql.DataSource=rocks