public static function createDatabase($name, $server, $user, $password) {
    $created = false;
    if($name && $server && $user) {
      // setup connection
      $conn =null;
      try {
        $conn = new PDO("mysql:host=$server", $user, $password);
      }
      catch(\Exception $ex) {
      	throw new PersistenceException("Couldn't connect to MySql: ".$ex->getMessage());
      }
      // create database
      $sqlStmt = "CREATE DATABASE IF NOT EXISTS ".$name;
      $result = $conn->query($sqlStmt);
      if ($result) {
        $created = true;
      }
      if (!$created) {
  	    throw new PersistenceException("Couldn't create database: ".$conn->errorInfo());
      }
    }
  }