【问题标题】:Run commands on BaseX database在 BaseX 数据库上运行命令
【发布时间】:2018-09-09 14:54:50
【问题描述】:

从理论的角度来看,如何在 Java 中运行 BaseX 数据库的命令(如 http://docs.basex.org/wiki/Commands 中描述的命令)。是否存在一些在高于 XPath 的抽象级别上工作的框架?

【问题讨论】:

    标签: java basex


    【解决方案1】:

    BaseX 提供了一大堆native language clients that directly connect with BaseX' API。

    使用QUERY命令归结为连接然后查询数据库,摘自官方查询documentation example:

    // create session
    BaseXClient session = new BaseXClient("localhost", 1984, "admin", "admin");
    final String input = "for $i in 1 to 10 return <xml>Text { $i }</xml>";
    Query query = session.query(input);
    while(query.more()) {
      System.out.println(query.next());
    }
    

    其他命令具有相同的接口。

    BaseX 也可以在 Java 的嵌入式模式下使用,请参阅 BaseX 文档的 "Local Examples" 部分。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-11-25
      • 1970-01-01
      • 2015-05-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-14
      相关资源
      最近更新 更多