28.01.2013 Views

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Note: The following example is for illustration purposes only. In the example shown,<br />

TiPackage is the absolute path to the table-import package in the repository and<br />

TiTable is the name of the table that is the target for the data-import operation.<br />

$.response.contentType = "text/plain";<br />

var conn = $.db.getConnection();<br />

var pstatement1 = conn.prepareStatement( "SELECT * FROM<br />

\"TiPackage::TiTable\" WHERE \"Surname\"='NewFoo");<br />

var result = pstatement1.executeQuery();<br />

if (result)<br />

{<br />

if (result.next())<br />

{<br />

$.response.setBody('The sql statement execution was successful.');<br />

}<br />

else<br />

{<br />

$.response.setBody("No data found");<br />

}<br />

$.response.status = $.net.http.OK;<br />

}<br />

else<br />

{<br />

$.response.status = $.net.http.INTERNAL_SERVER_ERROR;<br />

}<br />

result.close();<br />

pstatement1.close();<br />

conn.close();<br />

7. Access the <strong>SAP</strong> <strong>HANA</strong> XS application with the following URL http://:<br />

80//.xsjs.<br />

You receive the message, The SQL statement execution was successful.<br />

<strong>SAP</strong> <strong>HANA</strong> <strong>Developer</strong> <strong>Guide</strong><br />

Setting Up the Persistence Model<br />

P U B L I C<br />

© 2012 <strong>SAP</strong> AG. All rights reserved. 91

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!