avatar image
Former Member

[XS OData] how to get DB connection for the Query operation(HTTP get method) in XSJS

Hello,

Is there any way to get database connection for xsodata service query operation (HTTP get method)? such as write operation (create/update/detele):

test.xsodata:

service namespace "namespace" {

"Schmea"."Table" // Table or View

as "Content" // Optional entity alias

create using "namespace:connection.xsjslib::setSession";

}

connection.xsjslib:

function setSession(param){

var sql = 'insert into table values()';

var pStmt = param.connection.prepareStatement(sql);

pStmt.executeUpdate();

pStmt.close();

}

Because I need to set the variable to this database connection to filter data in calculation view.

for example:

param.connection.prepareStatement("set session 'user'='manager'");

Thanks,

Eric

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers

Skip to Content