Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

Posting HANA DB content on Browser with XSJS

$
0
0

Hi Experts

I've written the following XSJS Source

 

var conn;
var body ='';
try{  conn = $.db.getConnection();  var query = 'SELECT  \"headline\", \"id\" FROM \"NEO_EZPCFVLMDTZUPGEXJALE0XXX\".\"LinkedIN_Connections\"';   //SELECT "headline" FROM "NEO_EZPCFVLMDTZUPGEXJALE01XXX"."LinkedIN_Connections" WHERE "id"='tGPI4qHOf'  var pstmt = conn.prepareStatement(query);  //pstmt.setInteger(1, id);   var rs = pstmt.executeQuery();   while (rs.next()) {   body+= rs.toString();  $.response.setBody(body);  }  $.response.status=$.net.http.OK;
}catch (ex) {   $.trace.error("Unable to retrieve system. " + ex.toString());   throw ex;   } 
finally {  if (conn)  {   conn.close();   } 
}

 

I just need to display the table fields on the browser(Without Using UI5) I was able to successfully  activate the file with no errors. I'm getting the following output.

table_op.jpg

I believe i've missed some function API. Do guide me.

 

Regards

Shashank K


Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>