on 01-09-2014 9:52 PM
Hi Colleagues,
I'm creating a html page that will enable the users to put the <iNumber> and the HANA user will be created in our local sandbox. To do it, I've created a procedure that creates the user, and I'm trying to call it from a XSJS file.
The problem is the following, since my page is public, since the idea is that everyone can access it and create the user, when the XSJS code gets the statement $.db.getConnection(); an error is returned: Error: db.getConnection: expects an authenticated session
Do you know how to pass the user and password for the connection, or do you have a different idea to solve my problem ?
Thanks and regards,
Roberto Falk
Hi Roberto Falk,
For Calling the database from xsjs,the session needs a username and password. Usually we pass it from the UI which istakeninthe xsjs. But if this is not case, you can have something as SQL Connection Configuration File i.e. xssqlcc that must be created and a database user to beassociated with it.
We need to then associate the connection file in the xsjs to db connection or you can provide it in the xsaccess file as anonymous connection.
The details can be found in Developer guide http://help.sap.com/hana/SAP_HANA_Developer_Guide_en.pdf section 8.5.
Thanks and Regards,
Anjali.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Perfect, exactly what I need. Thank you all!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to create an xssqlcc object and maintain the reference to that object in the xsaccess for this service or add the xssqlcc reference to the database connection in your xsjs code. Via this xssqlcc you can maintain the user name and password which will be used in the database connection for anonymous applications. Just search in the HANA Developers' Guide for xssqlcc. It details all the steps involved pretty well.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.