电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

TRS代码示例VIP免费

TRS代码示例_第1页
1/6
TRS代码示例_第2页
2/6
TRS代码示例_第3页
3/6
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...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部