The following is the code snippet which i used. i am using xml database. iget all the asset id at once and iterate over them one by one and write it to a file. Please let me know if you need more information
con = this.factory.newConnection();
XDBCStatement xstmt = con.createStatement();
String assetIdXquery = IMPORT_PREFIX + "\n" + "zap:get-published-ei-asset-ids()";
assetIdRs = xstmt.executeQuery(assetIdXquery);
while (assetIdRs.hasNext()) {
assetIdRs.next();
String assetId = assetIdRs.getString().asString();
assetL.add(assetId);
}
System.out.println("Asset Count: " + assetL.size());
Iterator it = assetL.iterator();
while(it.hasNext()){
cnt++;
String assetId = it.next().toString();
System.out.println("Counter " + cnt + " : " + assetId );
String assetXquery = IMPORT_PREFIX + "\n" + "zap:get-published-ei-report-test" + "(\"" + assetId + "\")";
assetRs = xstmt.executeQuery(assetXquery);
while (assetRs.hasNext()) {
assetRs.next();
String result = assetRs.getString().asString();
String line= composeString(result);
writeToFile(line,fos);
String lineForThumb = null;
lineForThumb = composeStringForThumb(result);
if (lineForThumb!=null){
writeToFile(lineForThumb,fosForThumb);
}
}
assetRs.close();
}
Let me know if you need more information
Thanks