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.
| 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.27.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.propertiesfile. 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=
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
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
| 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
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-UNNAMEDAdd 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
- 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.