SAP HANA Connection
Connect the platform directly to SAP HANA 2.0 or later, under SAP S/4HANA or SAP ECC, over JDBC. Use this route when you run SAP HANA yourself and your DBA approves a dedicated database user. Where database access isn’t allowed, for example on RISE with SAP, use the application layer instead.
Overview
The Synthesized Platform connects to SAP HANA using JDBC. Both source (input) and target (output) connections are configured as data sources in the platform. This covers SAP HANA 2.0 and later, used in both SAP S/4HANA and SAP ECC landscapes with SAP HANA as the underlying database.
Connection Configuration
JDBC URL Format
jdbc:sap://hostname:port/?databaseName=SYSTEMDB
Components:
| Component | Description |
|---|---|
|
SAP HANA server hostname or IP address |
|
Instance port (typically 3`<instance>`15, e.g., 39015 for instance 90) |
|
Database name (SYSTEMDB or tenant database name) |
Common Port Numbers
| Instance | Port |
|---|---|
Instance 00 |
30015 |
Instance 01 |
30115 |
Instance 02 |
30215 |
Instance 90 |
39015 |
Adding a Data Source
Via the UI
-
Navigate to Data Sources in the main menu
-
Click Add Data Source
-
Select SAP HANA as the database type
-
Enter connection details:
-
Name: Descriptive name (e.g., "SAP Production")
-
JDBC URL: Connection string
-
Username: Database user
-
Password: User password
-
-
Click Test Connection to verify
-
Click Save
Required Permissions
Source Database (Read)
-- Create user for TDK
CREATE USER TDK_USER PASSWORD "secure_password";
-- Grant schema read access
GRANT SELECT ON SCHEMA SAP_SCHEMA TO TDK_USER;
-- Grant system view access for metadata
GRANT SELECT ON SYS.SCHEMAS TO TDK_USER;
GRANT SELECT ON SYS.TABLES TO TDK_USER;
GRANT SELECT ON SYS.TABLE_COLUMNS TO TDK_USER;
GRANT SELECT ON SYS.CONSTRAINTS TO TDK_USER;
GRANT SELECT ON SYS.INDEXES TO TDK_USER;
GRANT SELECT ON SYS.REFERENTIAL_CONSTRAINTS TO TDK_USER;
Target Database (Write)
-- Create user for TDK
CREATE USER TDK_USER PASSWORD "secure_password";
-- Grant full access to target schema
GRANT ALL PRIVILEGES ON SCHEMA TARGET_SCHEMA TO TDK_USER;
-- Or create schema if needed
GRANT CREATE SCHEMA TO TDK_USER;
-- For schema creation mode
GRANT CREATE ANY ON SCHEMA TARGET_SCHEMA TO TDK_USER;
Connection Properties
SSL/TLS Configuration
Trust Store Setup
-
Export the SAP HANA server certificate
-
Import into a Java trust store:
keytool -import -alias saphana \
-file saphana_cert.pem \
-keystore truststore.jks \
-storepass changeit
Connection String with Trust Store
jdbc:sap://saphana.company.com:39015/?encrypt=true&trustStore=/path/to/truststore.jks&trustStorePassword=changeit
For the whole Java runtime
To use the trust store for every connection, pass it to the Java runtime of the worker or the CLI with JAVA_TOOL_OPTIONS:
export JAVA_TOOL_OPTIONS="-Djavax.net.ssl.trustStore=/path/to/truststore.jks -Djavax.net.ssl.trustStorePassword=<password>"
Replace changeit in these examples with your own trust store password.
Troubleshooting
Connection Refused
Symptoms: Unable to connect, connection refused error
Solutions:
-
Verify hostname and port are correct
-
Check network connectivity:
telnet hostname port -
Verify SAP HANA is running:
sapcontrol -function GetProcessList -
Check firewall rules allow the connection
Authentication Failed
Symptoms: Invalid credentials error
Solutions:
-
Verify username and password
-
Check user is not locked:
SELECT * FROM SYS.USERS WHERE USER_NAME = 'TDK_USER' -
Reset password if needed:
ALTER USER TDK_USER PASSWORD "new_password"
Permission Denied
Symptoms: Insufficient privileges error
Solutions:
-
Review required permissions above
-
Grant missing permissions
-
Verify schema names are correct
-- Check user permissions
SELECT * FROM SYS.EFFECTIVE_PRIVILEGES
WHERE USER_NAME = 'TDK_USER';
SSL Handshake Failed
Symptoms: SSL/TLS error during connection
Solutions:
-
Verify certificate is valid and not expired
-
Check trust store contains the correct certificate
-
For a self-signed certificate, import it into the trust store. Keep
validateCertificate=true.
Slow Connection
Symptoms: Connection takes long time to establish
Solutions:
-
Check network latency to the SAP HANA server, and run the worker close to it. See Synthesized Workers.
-
Check the platform’s connection pool size,
TDK_DB_MAXIMUM-POOL-SIZE. See Application Properties.
Best Practices
Use Dedicated Users
Create separate database users for TDK:
-
Different users for different environments
-
Minimal permissions required
-
Easy to audit and revoke