on 11-17-2015 1:55 AM
Hi experts,
I create an AdminConn.xssqlcc file. In HANA XS Admin Tool I set the following configration:
And I add the content "anonymous_connection" : "test::AdminConn" in .xsaccesss file.
But I execute the test.xsjs, the error page display:
test.xsjs |
---|
function test() { var body; var conn; $.response.status = $.net.http.OK; try { conn = $.db.getConnection("test::AdminConn"); var pStmt = conn.prepareStatement("select CURRENT_USER from dummy"); var rs = pStmt.executeQuery(); if (rs.next()) { body = rs.getNString(1); } rs.close(); pStmt.close(); } catch (e) { body = "Error: exception caught"; $.response.status = $.net.http.BAD_REQUEST; } if (conn) { conn.close(); } $.response.setBody( body ); } test(); |
The xssqlcc can work, what should I do?
Candy Zhang
Hello,
there can be several reasons why it does not work (e.g. auto generated user has not enough rights, ...).
Please can you return the message of the exception object to get a hint on what is wrong (-> replace your line "body = "Error: exception caught" by "body = e.message").
One problem is that your xssqlcc file is in a a different package (test) than your xsjs service (test/services). The xssqlcc file must be in the same package than the app (or service) which uses it.
Best Regards,
Florian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.