Skip to main content

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 3.5.9 with Java 17 (or Java 21)
  • Spring Boot 2.7.3 with Java 8 (JDK 8)

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.

DatabaseJDBC DriverDatabase Versions
Oracleojdbc8.jarOracle 21c, 19c, 18c, and 12.2
MS SQL Server10.2.1.jre8SQL Server 2019 (2017, 2016, 2014, 2012)
Azure SQL10.2.1.jre8Azure SQL
PostgreSQL42.5.1PostgreSQL 8.2 or newer
MySQL Newer Ver8.0.31MySQL Server 8.0, 5.7 and 5.6
MySQL5.1.49MySQL Server ver 5.0, 5.5
Snowflake3.27.0for *.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.

Some examples:

# mysql
# -----------------------------------------------------------------
#spring.datasource.url=jdbc:mysql://localhost:3306/DBNAME?useUnicode=true&characterEncoding=utf8
#spring.datasource.username=user
#spring.datasource.password=pwd
#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
  • Snowflake (snowflake)
spring.datasource.url=jdbc:snowflake://<Your_IDs>.snowflakecomputing.com/?warehouse=&db=ORDERS&schema=PUBLIC
spring.datasource.driverClassName=net.snowflake.client.jdbc.SnowflakeDriver
spring.jpa.properties.hibernate.dialect=com.example.emapi.app.SnowflakeDialect

Please Also provide datbase user and password.

spring.datasource.username=
spring.datasource.password=
tip

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)

Azure SQL (mssql)

Snowflake

tip

Snowflake needs additional datasource properties and some java runtime options.

Snowflake - Data Types

Snowflake To PostgreSQL data type comparison

Snowflake To PostgreSQL data type mapping details

SnowflakePostgreSQL
NUMBERint
DECIMAL
NUMERIC
INT
INTEGER
BIGINT
SMALLINTsmallint
TINYINTsmallint
BYTEINTsmallint
FLOATfloat4
FLOAT4float4
FLOAT8float8
DOUBLEdouble precision
DOUBLE PRECISION
REAL
VARCHAR
CHAR
CHARACTER
STRINGvarchar or text
TEXT
BINARYbytea
VARBINARYbytea
BOOLEAN
DATE
DATETIMEtimestamp
TIME
TIMESTAMPtimestamp
TIMESTAMP_LTZtimestamp with time zone
TIMESTAMP_NTZtimestamp with time zone
TIMESTAMP_TZtimestamp with time zone

Using Snowflake as runtime database

Additonal Datasource Properties

Below additonal Datasource Properties are Needed

spring.datasource.driverClassName=net.snowflake.client.jdbc.SnowflakeDriver
spring.jpa.properties.hibernate.dialect=com.example.emapi.app.SnowflakeDialect

Note: The SnowflakeDialect is EmptyDialect, and provided in code.

  • Java file: emapi\lib\base-app\src\main\java\com\example\emapi\app\SnowflakeDialect.java
Need to Add Flag to Java Runtime

You need to include below flag in the command you use to launch your Java application

  • Flag: --add-opens=java.base/java.nio=ALL-UNNAMED

  • Add via IntelliJ IDEA Run Configuration: VM options or if using command line, see below.

java --add-opens=java.base/java.nio=ALL-UNNAMED -jar app\dbrest\target\dbrest-1.0-SNAPSHOT.jar

Compatible Databases

Compatible Databases: Below Postgres or other compatible databases should be able to be used for Import and runtime deployment:

Databases