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.2.3 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.
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.19.0 | 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 Snowflake - you can use work around solution For Import Tables.
Snowflake - work around solution For Import Tables
For Import Tables and generating code for snowflake:
- Please note, you can create snowflake tables equivalents in postgresql db and use them to import in Studio Builder and generate code.
- Get Snowflake Tables Creation SQL script.
- Edit/Make changes to load these tables in PostgreSQL. See chart below for data type mapping.
- Load tables in PostgreSQL.
- Import tables.
- And generate code with configuration
- For runtime select Database Type : Snowflake
- Or follow next section steps to configure Snowflake as runtime database.
Snowflake To PostgreSQL data type mapping
Snowflake To PostgreSQL data type mapping details
- Suggested are substitutions on postgresql side.
- Use same, if data type available in postgresql.
Snowflake | PostgreSQL |
---|---|
NUMBER | int |
DECIMAL | |
NUMERIC | |
INT | |
INTEGER | |
BIGINT | |
SMALLINT | smallint |
TINYINT | smallint |
BYTEINT | smallint |
FLOAT | float4 |
FLOAT4 | float4 |
FLOAT8 | float8 |
DOUBLE | double precision |
DOUBLE PRECISION | |
REAL | |
VARCHAR | |
CHAR | |
CHARACTER | |
STRING | varchar or text |
TEXT | |
BINARY | bytea |
VARBINARY | bytea |
BOOLEAN | |
DATE | |
DATETIME | timestamp |
TIME | |
TIMESTAMP | timestamp |
TIMESTAMP_LTZ | timestamp with time zone |
TIMESTAMP_NTZ | timestamp with time zone |
TIMESTAMP_TZ | timestamp with time zone |
Using Snowflake as runtime database
For using snowflake during runtime, use below steps.
- Add dependency to
pom.xml
<dependency>
<groupId>net.snowflake</groupId>
<artifactId>snowflake-jdbc</artifactId>
<version>3.19.0</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=com.example.emapi.app.EmptyDialect
Note: The EmptyDialect needs to be added in source.
- Create a java source file
emapi\lib\base-app\src\main\java\com\example\emapi\app\EmptyDialect.java
- with below content:
package com.example.emapi.app;
import org.hibernate.dialect.Dialect;
public class EmptyDialect extends 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.