检索例子1 package com
client
tests; import com
client
*; public class SearchTest1 { public static void main(String[] args) throws Exception { String sHost = "127
1"; String sPort = "8888"; String sUserName = "system"; String sPassWord = "manager"; TRSConnection trscon = null; TRSResultSet trsrs = null; try { // 建立连接 trscon = new TRSConnection(); trscon
connect(sHost, sPort, sUserName, sPassWord); // 从demo3中检索标题中含有"中国"的记录 trsrs = trscon
executeSelect("demo3", "标题=中国", "", "", "正文", 0, TRSConstant
TCE_OFFSET, false); // 输出记录数 System
println("记录数:" + trsrs
getRecordCount()); // 设置概览/细览字段, 提高记录的读取效率 trsrs
setReadOptions("日期;版次;作者;标题", "正文", ";", TRSConstant
TCE_OFFSET, 0); // 输出前 20条记录 for (int i = 0; i < 20 && i < trsrs
getRecordCount(); i++) { trsrs
moveTo(0, i); System