Hello,
I need to create XSJS-service which will make search using a next clause
SELECT C1, C2 FROM T1 WHERE C2 IN ('01', '02')
, where search string '01', '02' will be a url parameter:
service call url:
http://server/service.xsjs&query=01,02
Simple service text:
//get search string from url parameter
var search = $.request.parameters.get('query');
var conn = $.db.getConnection();
query = "SELECT C1, C2 FROM T1 WHERE C2 IN (?)"
pstmt = conn.prepareStatement(query);
pstmt.setString(1, search);
rs = pstmt.executeQuery();
Unfortunately, setString method assign search string as a one big string '01,02', and select doesn't return any data.
How I can assign a list of values to query parameter? Any ideas?