Skip to Content
Technical Articles

Anonymous Call to access XSJS service using SQLCC

     This post focuses on how you can bypass the HANA logon or make an anonymous call for accessing an XSJS service. I would also share the challenge I faced when a XS app was wrapped as an Android app. How to create an Android PhoneGap plugin for UI5 Mobile

     We might come across a situation where we need to bypass the default Form/Basic authentication. In my case, after wrapping the XS App into an .apk I couldn’t navigate to any of my XSJS services unless I logged in with the usual HANA logon authentication. SQLCC helps by enabling us to configure the connection to the database, we can also use specific config for your individual SQL Connections. Below are the steps to achieve this.

Roles you would require:

  1. sap.hana.xs.admin.roles::SQLCCViewer
  2. sap.hana.xs.admin.roles::SQLCCAdministrator


The first step would be to create an .xssqlcc file in your XS project or using New -> Other -> Application Development -> SQL Configuration File


“description” : “Test SQL connection”


Activating this would create an entry in “_SYS_XS”.”SQL_CONNECTIONS”. Note that the USERNAME needs to be updated.


  •      Update the USERNAME using the below URL




                   After Update :


  •      You can manage the security for your package from the below link.


Once the XSSQLCC is created, all you need to do is to use it in your application. We can do this in two ways :


          1) Set the parameter in my .xsaccess file


   “anonymous_connection”: “SQLCC::testsqlcc”,

   “exposed” : true,

   “authentication” : null


          2) Passing the “SQLCC::testsqlcc” as parameter in my $.db.getConnection();

          Note : SQLCC file and the XSJS service SHOULD be in the same package, so that service can access the SQL Connection Configuration file

          Below is a simple snippet of a XS app that calls the SQLCC .

//Open a DB connection

  var conn = $.db.getConnection(“SQLCC::testsqlcc”);

  var oResult = [];


  var pstmt = conn.prepareStatement(sql);

  var rs = pstmt.executeQuery();



  “ID” : rs.getString(1),

  “Name” : rs.getString(1),








And now I have a service which does not throw a Basic pop up/Form logon. This helped us in navigating to the required service from the XS app which was wrapped as Android App.

Another authentication which you could explore would be OAuth !


Hope this post was helpful !


Avinash Raju

SAP HANA Consultant

You must be Logged on to comment or reply to a post.
  • Good information Avinash,

    I’m getting below error when trying to call procedure from xsjs file:

    “dberror(CallableStatement.execute): 2048 – column store error: search table error: [2620] executor: plan operation failed;Can not insert data from temp table into Result_Table”

    I have verified i/p & o/p data types and the same code works fine on studio SQL editor , but facing issue only executing the same from xsjs.

    Please let me know any other suggestions ..

    Thanks & Regards,

    Anup Singh

    • /
      • Hey! So I am trying to do this and can’t seem to find where one would set up the username. I have already granted the RuntimeConfAdministrator role.


        I just see a view of the sqlcc object where it says Username is ‘Not Set’. What am I missing?

    • You can, just log on to the web based development workbench of your hana mdc created in hcp trial, and in the Editor, follow the path in the directory structure starting from root: /sap/hana/xs/admin/ and you’ll find an index.html there which you have to start. But first assign in the Security tool all *xs.admin* roles to e.g. your SYSTEM user.

      • Hey! As I described above, (response to Xana Rasquin’s comment) I cant seem to find how to setup username. I have granted to appropriate privileges and everything but I simply don’t see a button that would allow me to setup the username.

  • Nice to see this blog, and I also would like to know one more point here – if we implement this then when we run the service will it asks HANA access credentials OR is it suffice that if we give the USERNAME and PASSWORD what we created here?



  • Hi Avinash,


    How can I add job scheduler job role using sqlcc? is it possible? a user will have login credentials but won’t have job schedule role.



  • can anonymous authorization also be used for HAN File Api ? to get XSRF token and make file uploads on vs server using this feature