Tupelo has a mechanism for configuration of Contexts that front a database by permitting administrator authentication and management. Any Context that extends BaseSqlContext permits this.

Note: Tupelo does not supply the database engine itself (e.g. mysql, oracle) as part of the distribution. A full discussion of database administration for every system is not possible here, so it is assumed that you have read the documentation for your system.

There are several properties that need to be managed. It is easiest to group them as follows:

General properties.

These apply to the database regardless of who is connecting.

  • The host for the database.
  • The port for the database.
  • The driver class for the jdbc. Most implementations load this automatically.
  • The schema name (some databases refer to the database name rather than the schema name).
  • The table prefix: An optional prefix for every table and index created by Tupelo. This permits multiple Contexts per given schema.

Tupelo will create several tables for each context along with various indexes. The table prefix will be pre-pended to all of these.

Administrative properties.

These related specifically to database management by an administrator.

  • The administrator's user name: The name of the administrator. Note that if omitted this defaults to the user's name.
  • The administrator's password: The password of the administrator.
  • The administrator's jdbc url: The specific url used by the database for administration.

Client properties.

These relate to usage of the database by a client.

  • The user's name
  • The user's password
  • The user's jdbc url.

Not all databases use all of these properties and good practice would create specific instances for administrative or client. Normally specific implementations will supply reasonable defaults for many of these, such as port and driver. Usually the url will also be constructed from the host, port, schema, username and password plus whatever else the database requires. Alternately, you may set the url directly. Please refer to the documentation specific to your context.

Example. The H2Context defaults to embedded mode, which has no specific administrator management. To use the database in server mode you would directly supply the jdbc url with all relevant information.

  • No labels