Database Connection Checklist

In PowerServer's n-tier architecture, database connections are made from PowerServer to the database, unlike traditional client/server applications where each client connects directly to the database. This section highlights the key differences and configuration steps necessary to set up database connection for an installable cloud app.

  • The use of an intermediary layer (the PowerServer) introduces some important changes in how database connections, transactions, and data operations are handled compared to traditional client/server applications. Understanding these differences is essential for ensuring a successful migration to PowerServer.

    For key differences, refer to Concept differences.

  • The easiest way to set up and manage database connections for the PowerServer cloud app is to define all required databases in the Database Configuration section of the PowerServer project painter. These settings will be deployed alongside the project to PowerServer. Although it is possible to change some of these settings in PowerServer via the config file, the intuitive PowerServer project painter remains the preferred method for configuring and managing database connections.

    The process of configuring a database connection includes the following key steps:

    1. Create a connection cache for each database your app will use. The compiler (as well as PowerServer) uses the cache for database connection. It cannot reuse the database profile which is created for the client/server app.

    2. Provide full-access credentials (username/password) for the database. The compiler needs to have full access to all tables in order to generate C# models correctly. When the data source of DataWindow is a stored procedure, the compiler also needs to have permissions to execute the stored procedure.

    3. Download the appropriate .NET Core data provider. The provider must be installed to both the IDE and the PowerServer C# solution. You can either manually download and install the provider, or have PowerBuilder automatically download and install it for you.

    4. (Optional) To allow users to connect using their own database credentials, select the option "Allow dynamic connection using the transaction LogID and LogPass". The application will use the credentials provided at runtime to log in to the database server.

    5. Associate the cache with the appropriate transaction object. For each transaction object that exists in the application, you need to map it with a cache. This can be done either within the IDE or programmatically using the CacheName property in scripts.

    For step-by-step instructions, refer to Walkthrough: Connecting to the database.

    To learn more about programmatically mapping caches to transactions, see Dynamic connection.

  • Special notes for SQL Anywhere and ASE

    • PowerServer connects to SQL Anywhere and ASE using ODBC rather than a database-specific provider.

    • Configure the ODBC DSN on the server hosting PowerServer (not on client machines).

    • For 64-bit operating systems, configure a 64-bit DSN unless your Web APIs are compiled as 32-bit.