Quantcast
Channel: SCN : All Content - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6745

XSJS file giving error

$
0
0

Hi,

 

I am following opensap course on hana development

 

when i tried to create the hello world program as mentioned in the course material I am getting an error as follows, while trying to run the program. Please some one can help me on this

 

The follwing is the code which I copied from opensap

 

$.response.contentType = "text/html";

 

 

var output = "Hello Hana World<br><br>";

var conn = $.db.getConnection();

var pstmt = conn.prepareCall("select * from DUMMY");

var rs = pstmt.execute();

 

 

if (!rs.next()) {

  $.response.setBody(" Fail to retrieve Data");

  $.response.status = $.net.http.INTERNAL_SERVER_ERROR;

}

else {

  output = output + "This is the response from My SQL :"

  + rs.getString(1);

}

rs.close();

pstmt.close();

conn.close();

$.response.setBody(output);

 

The above code is giving me an error as the attached image.

 

It seems some error in the syntax rs.next()

 

rs.next.PNG


Viewing all articles
Browse latest Browse all 6745

Trending Articles



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