title: Calling XSJS file in SAPUI5 for writng data on HANA
body: <p>I'm trying to create a service to write data from a SAPUI5 frontend to HANA tables. 
  As far as I checked, I believe this is not possible via OData Services. So I've found another way, sing an XSJS file with a SQL INSERT statement.</p>
  
  <p>Now, my problem is using this in UI5. As with OData, I would use something like oModel.create but now I think this doesn't work like that.</p>
  
  <p>Those anyone has a clue?</p>
  
  <p>Thanks!</p>
  
  <p>Eva</p>
  
  <p>UPDATE:
  After using the first answer, I tried to create an entry in a HANA Table, but I'm getting a 500 error. Here's the code of the xsjs file:</p>
  
  <pre><code>var data = '', conn = $.db.getConnection(), pstmt;  
  
          if($.request.body){
              data = $.request.parameters.get("firstName");   
          }
  
          var conn = $.db.getConnection();
          var pstmt = conn.prepareStatement( 'INSERT INTO "Z003HB1N"."T_TEST" (FIRSTNAME) VALUES(?)' );
  
          pstmt.setString(1,data);
  
          pstmt.execute();
          pstmt.close();
  
          conn.commit();
          conn.close();
  
          doResponse(200,'');
  
          $.response.contentType = 'text/plain';
          $.response.setBody('Upload ok');
          $.response.status = 200;
  </code></pre>
  
  <p>Any clue what might be wrong?</p>