1 . 检索例子1 package com.trs.client.tests; import com.trs.client.*; public class SearchTest1 { public static void main(String[] args) throws Exception { String sHost = "127.0.0.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.out.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.out.println("第" + i + "条记录"); System.out.println(trsrs.getString("日期")); System.out.println(trsrs.getString("版次")); System.out.println(trsrs.getString("作者")); System.out.println(trsrs.getString("标题", "red")); } } catch (TRSException ex) { // 输出错误信息 System.out.println(ex.getErrorCode() + ":" + ex.getErrorString()); ex.printStackTrace(); } finally { // 关闭结果集 if (trsrs != null) trsrs.close(); trsrs = null; // 关闭连接 if (trscon != null) trscon.close(); trscon = null; } } } 2 . 检索例子 2 package com.trs.client.tests; import com.trs.client.*; public class SearchTest2 { public static void main(String[] args) throws Exception { String sHost = "127.0.0.1"; String sPort = "8888"; String sUserName = "system"; String sPassWord = "manager"; String sLicenseCode = null; TRSConnection trscon = null; TRSResultSet trsrs = null; try { // 建立连接 trscon = new TRSConnection(); trscon.connect(sHost, sPort, s...