Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Version History

« Previous Version 5 Next »

This API was added in Profound.js 5.0.0

This API returns a database connection definition object that can be passed to some SQL and Data APIs to specify the desired database connection.

Parameters

  1. Database connection name (String/optional). A name corresponding to an entry in the databaseConnections configuration option.

    If this parameter is omitted, then the default database connection definition is returned. In Profound.js Spaces, the default database connection is normally the workspace's built-in MariaDB database. However, if the Profound.js Spaces workspace is called from IBM i using the NODERUN command, the default database connection is overridden to work with the calling IBM i database. In this case the workspace's built-in MariaDB database can be accessed by passing connection name "workspace".

Exception Handling

An exception is is thrown if the database connection name is not valid.

Example

pjs.query("select * from mytable"); // Query runs against default database connection.
pjs.query(pjs.getDB("crm"), "select * from mytable"); // Query runs against database connection "crm".
  • No labels