Skip to Content
0
Sep 30, 2019 at 10:06 AM

Accessing HANA via SQLCC ONLY in XSA

133 Views

In an XSA application [1], SQLCC config would be made to access HANA database that is outside HDI container as a secondary connection. The SQLCC config would be attached to hana options as below.

// configure HANA SQLCC
try {
	options.hana.sqlcc = xsenv.getServices({ "xsjs.sqlcc_config": "NAME-OF-USER-PROV-SERVICE" });
} catch (err) {
	console.log("[WARN]", err.message);
}

But what if the XSA application ONLY connects to a database that resides outside HDI. I have tried to attach the sqlcc config to options alone. But doing so would make the $.hdb API object undefined. This results in Cannot read property 'getConnection' of undefined. Can anyone help me here? TIA.

var oConnection = $.hdb.getConnection({
    "sqlcc": "xsjs.sqlcc_config",
    "pool": true
});

[1] https://www.youtube.com/watch?v=8QxcmeN_Slk&list=PLoc6uc3ML1JR38-V46qhmGIKG07nXwO6X∈dex=33&t=0s