Example #1
0
 @Override
 public void run() {
   try {
     // Perform query
     session.execute("xquery " + QUERY);
     session.close();
   } catch (final Exception ex) {
     ex.printStackTrace();
   }
 }
Example #2
0
 @Override
 public void run() {
   try {
     // Perform some queries
     for (int i = 0; i < runs; ++i) {
       final String qu =
           read
               ? "count(db:open('test'))"
               : "db:add('test', <a/>, 'test.xml', map { 'intparse': true() })";
       session.execute("xquery " + qu);
     }
     session.close();
   } catch (final Exception ex) {
     ex.printStackTrace();
   }
 }
Example #3
0
    @Override
    public void run() {
      try {
        // Perform some queries
        for (int i = 0; i < runs; ++i) {
          Performance.sleep((long) (50 * RND.nextDouble()));

          // Return nth text of the database
          final int n = RND.nextInt() % MAX + 1;
          final String qu = Util.info(QUERY, n);
          session.execute("xquery " + qu);
        }
        session.close();
      } catch (final Exception ex) {
        ex.printStackTrace();
      }
    }