KB Article #179637
How to test a database connection from the API Gateway host
Problem
Policy Studio database test connection button shows success but the gateway trace file is showing errors like this
ERROR 2018/07/04 14:21:04.991 Error connecting to database for Database Logger! :
com.vordel.es.EntityStoreException: cannot configure database connection
at com.vordel.common.db.DbConnectionCache.getConnection(DbConnectionCache.java:73)
The Policy Studio test is coming from the local machine and it may have access to the database but this doesn't test the actual connection used from the gateway.
Resolution
Attached are the scripts to test the database connection from the gateway installations.
- Edit the files with the db jdbc url, username and password.
- The ext/lib directory should contain the database driver for oracle/mysql/sqlserver
- Drop the script files in apigateway/samples/scripts and analytics/samples/scripts (remove .txt extension)
- cd apigateway/samples/scripts and analytics/samples/scripts
- call
- ./run.sh test_jdbc_with_query.py
- ./run.sh test_jdbc.py
- should run OK and not show an exception