Database tips

Database Compatability

Zcore is compatable with the following databases with varying levels of completion:

  • Derby
  • MySQL
  • MS SQL Server - very basic compatability

Code for switching between database-specific synctax:

if (Constants.DATABASE_TYPE.equals("derby")) {
// insert code here
} else if (Constants.DATABASE_TYPE.equals("mssql")) {
// insert code here
}

Set the database in application.properties database.type using the following choices:

  • database.type=derby
  • database.type=mysql
  • database.type=mssql

Dynasite generates the sql used in most queries. To make database-specific changes to those queries, edit SqlGenerator and re-generate the sql.

The DatabaseCompatability class has a few methods that render compatable string. Example:

DatabaseCompatability.concat("", "u.lastName", "', '", "u.forenames") + " AS ModUserName, " +

See the following pages for tips on database-specific syntax.