Create Database Datasource

This type of datasource allows the app to query data from a database.

Perform the following steps:

  1. In ASG-Studio, go to the project in which you want to add Datasource.
  2. Navigate to the Datasources folder, click New and then click Datasources from the context menu.
  3. As Type of Data source select Database.
  4. Enter a name for the datasource in the Name field.
  5. The datasource name can contain only alphanumeric characters and space. The name can start only with a letter. The name cannot contain special characters. The maximum length of the name is limited to 30 characters.
  6. Under Connection Type, choose either JDBC String (Java Database Connection String) to manually enter the connection string, or Database Type to fill in the database details and let the system form the JDBC string for you.
    1. If you select JDBC String, enter the string in the corresponding format.
    2. If you select Database Type, enter the required connection parameters.
    3. ASG-Studio supports the following database types to use as datasource for your apps:

      • PostgreSQL 10 or higher
      • ASG-Zenith Portal currently supports the apps that are designed using only PostgreSQL 10 as datasource. If you want to deploy your app using ASG-Zenith Portal, you must specify only PostgreSQL as Database Type while creating the datasource in the corresponding project.
      • Oracle 12c or higher
      • Microsoft SQL 2015 or higher
      • MySQL 8 or higher
        MySQL database requires JDBC driver to enable ASG-Studio to connect with your app database. If you are using MySQL as your app database, download the MySQL Connector/J from this link and add the file to the ASG-Studio installation folder.
        The downloaded file has the name similar to mysql-connector-java-8.0.19.jar where 8.0.19 is the version number.
        The path where the downloaded file must be copied to: ..\<ASG-Studio installation folder>\bin\lib\.
  7. Enter the Username and Password that give access to the database, and under Is Active, select whether these user credentials are currently active or not.
  8. Use the Choose connection pool size slider to choose the number of connection pools to create for the JDBC string. You can use a maximum of 5 connection pools for each JDBC string.
  9. Optionally, if you have set the user credentials as active, you can test the connection by clicking Test.
  10. Click Save.
  11. The database datasource is created. You can now add webservice methods to the datasource.