APIs Reference
Common aspects reference guide for Backend APIs - GraphQL and REST APIs.
Purpose
Backend APIs - GraphQL and REST APIs are Spring Java projects and share a common framework and mechanism.
Please find information on those common aspects pertaining to:
- Support matrix and versions information for languages, tools & technologies, databases, etc.
- Database Deployment support matrix, databases, versions, etc.
APIs Features Reference
Common aspects pertaining to APIs features reference guide for Backend APIs - GraphQL and REST APIs.
Feature support
Please refer to list at Backend Features
Backend APIs Deployment - Support Matrix
This page mentions version compatibilities for our support matrix.
API Development Framework, Language
- Spring Boot 2.7.3 with Java 8 (JDK 8)
- Spring Boot 3.2.3 with Java 17 (or Java 21)
- Supported via minor customization refer to section Backend Templates
Databases
Databases supported for runtime deployment are Oracle, MySQL, MariaDB, PostgreSQL, MS SQL Server, Azure SQL, Snowflake, (DB2, H2, HSQLDB).
Please also see compatible-databases list.
Please contact us for help on any suported databases, for which details are not provided.
Database Drivers and Supported Database Versions
Below are provisions in pom.xml
. Some old database versions and drivers will also work. Try them out if needed or contact us.
Database | JDBC Driver | Database Versions |
---|---|---|
Oracle | ojdbc8.jar | Oracle 21c, 19c, 18c, and 12.2 |
MS SQL Server | 10.2.1.jre8 | SQL Server 2019 (2017, 2016, 2014, 2012) |
Azure SQL | 10.2.1.jre8 | Azure SQL |
PostgreSQL | 42.5.1 | PostgreSQL 8.2 or newer |
MySQL Newer Ver | 8.0.31 | MySQL Server 8.0, 5.7 and 5.6 |
MySQL | 5.1.49 | MySQL Server ver 5.0, 5.5 |
Snowflake | 3.13.32 | for *.snowflakecomputing.com |
Connecting Databases
Connection examples of providing spring.datasource
parameters such as URL, etc as per db type :
- Please refer to
application.properties
file. Uncomment parameters for the database you want to use.
# mysql
# -----------------------------------------------------------------
#spring.datasource.url=jdbc:mysql://localhost:3306/DBNAME?useUnicode=true&characterEncoding=utf8
#spring.datasource.username=user
#spring.datasource.password=pwd
#spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
#spring.datasource.driverClassName=com.mysql.jdbc.Driver
#spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
#spring.jpa.hibernate.ddl-auto=update
# -----------------------------------------------------------------
...
# mssql Azure SQL
# -----------------------------------------------------------------
# Use with Azure Cloud Shell or Azure CLI
#spring.datasource.url=jdbc:sqlserver://${AZ_DATABASE_NAME}.database.windows.net:1433;database=EMDB;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;
#spring.datasource.username=spring@${AZ_DATABASE_NAME}
#spring.datasource.password=${AZ_SQL_SERVER_PASSWORD}
#spring.jpa.hibernate.ddl-auto=update
# -----------------------------------------------------------------
Connecting Databases examples
Connection examples of providing URL as per db type :
- Oracle (oracle)
spring.datasource.url=jdbc:oracle:thin:@127.0.0.1:1521:XE
- MS SQL Server (mssql)
spring.datasource.url=jdbc:sqlserver://127.0.0.1:1433;databaseName=EMDB;encrypt=true;trustServerCertificate=true;
- Azure SQL (mssql)
spring.datasource.url=jdbc:sqlserver://${AZ_DATABASE_NAME}.database.windows.net:1433;database=EMDB;encrypt=true;
- PostgreSQL (psql)
spring.datasource.url=jdbc:postgresql://localhost:5432/emdb?useUnicode=true&characterEncoding=utf8
Using Amazon RDS | AWS RDS , e.g. :
spring.datasource.url=jdbc:postgresql://<db.client_id>.us-west-1.rds.amazonaws.com:5432/<db_name>?useUnicode=true&characterEncoding=utf8
- MySQL (mysql)
spring.datasource.url=jdbc:mysql://localhost:3306/DBNAME?useUnicode=true&characterEncoding=utf8
Please Also provide datbase user and password.
spring.datasource.username=
spring.datasource.password=
Below parameters, if skipped, are set to defaults for driver, and should not pose any issues.
#spring.datasource.driverClassName=
#spring.jpa.properties.hibernate.dialect=
Help on Setting-Up Databases
MS SQL Server 2019 Express (mssql)
- To setup tcp connection, fixed port needs to be configured for IPAll, Refer to guide at Configure a Server to Listen on a Specific TCP Port
Azure SQL (mssql)
- Refer to setup guide at Microsoft Learn: Use Spring Data JPA with Azure SQL Database
Snowflake
For generating code for snowflake:
- Please note, you can create snowflake tables temporarily in postgresql db and use them to import in Studio Builder and generate code.
For using snowflake during runtime, use below steps.
- Add dependency to
pom.xml
<dependency>
<groupId>net.snowflake</groupId>
<artifactId>snowflake-jdbc</artifactId>
<version>3.13.32</version>
</dependency>
- Setup
application.properties
as:
# snowflake
# -----------------------------------------------------------------
spring.datasource.url=jdbc:snowflake://<account>.snowflakecomputing.com/?warehouse=<warehouse_name>&db=<db_name>&schema=<schema_name>&CLIENT_RESULT_COLUMN_CASE_INSENSITIVE=true&CLIENT_TIMESTAMP_TYPE_MAPPING=TIMESTAMP_NTZ&JDBC_TREAT_DECIMAL_AS_INT=false
spring.datasource.username=
spring.datasource.password=
spring.datasource.driverClassName=net.snowflake.client.jdbc.SnowflakeDriver
spring.jpa.properties.hibernate.dialect=emrest.spring.EmptyDialect
Note: The EmptyDialect needs to be added in source. Create a java source file EmptyDialect.java
in src/ folder, with below content:
package emrest.spring;
public class EmptyDialect extends org.hibernate.dialect.Dialect {}
Compatible Databases
Compatible Databases: Below Postgres or other compatible databases should be able to be used for Import and runtime deployment:
Databases
- Aiven PostgreSQL
- Google AlloyDB Postgres
- AWS RDS | AWS Aurora
- MySQL and PostgreSQL
- Azure Cosmos DB for PostgreSQL
- Azure Postgres database
- Crunchy Postgres
- DigitalOcean Postgres
- ElephantSQL Postgres
- EnterpriseDB (BigAnimal) Postgres
- GCP Cloud SQL database
- MySQL, PostgreSQL, and SQL Server
- Heroku Postgres Database
- Neon Postgres
- Railway Postgres
- Render Postgres
- Supabase Postgres
- Timescale Postgres
- Yugabyte Postgres
- Citus Postgres Distributred Db
- CockroachDB
- CockroachDB is an open-source, cloud-native, distributed SQL database. It is Postgres-compatible.