code:     public String createDB(String dbName) {
  
          // ensure there are no illegal chars in DB name
          InputUtils.validateSafeInput(dbName);
  
          String result = DB_CREATED_MSG + ": " + dbName;
  
          Connection conn = null;
          try {
              conn = DerbyConnectionUtil.getDerbyConnection(dbName,
                      DerbyConnectionUtil.CREATE_DB_PROP);
          } catch (Throwable e) {
              if (e instanceof SQLException) {
                  result = getSQLError((SQLException) e);
              } else {
                  result = e.getMessage();
              }
          } finally {
              // close DB connection
              try {
                  if (conn != null) {
                      conn.close();
                  }
              } catch (SQLException e) {
                  result = "Problem closing DB connection";
              }
          }
  
          return result;
      }
  
  