Example #1
0
 @Override
 public Item item(final QueryContext qc, final InputInfo ii) throws QueryException {
   checkCreate(qc);
   final String driver = string(toToken(exprs[0], qc));
   if (Reflect.find(driver) == null) throw BXSQ_DRIVER_X.get(info, driver);
   return null;
 }
Example #2
0
 /**
  * Performs the test-uris function.
  *
  * @param ctx query context
  * @return resulting value
  * @throws QueryException query exception
  */
 private Item testUris(final QueryContext ctx) throws QueryException {
   checkCreate(ctx);
   final ArrayList<IO> inputs = new ArrayList<>();
   final Iter ir = ctx.iter(expr[0]);
   for (Item it; (it = ir.next()) != null; ) inputs.add(checkPath(it, ctx));
   return new Suite(ctx, info).test(inputs);
 }
Example #3
0
 /**
  * Performs the test-libraries function (still experimental).
  *
  * @param ctx query context
  * @return resulting value
  * @throws QueryException query exception
  */
 private Item testLibraries(final QueryContext ctx) throws QueryException {
   checkCreate(ctx);
   final TokenList tl = new TokenList();
   final Iter ir = ctx.iter(expr[0]);
   for (Item it; (it = ir.next()) != null; ) tl.add(checkStr(it));
   return new Suite(ctx, info).test(tl);
 }
Example #4
0
 @Override
 public Item item(final QueryContext ctx, final InputInfo ii) throws QueryException {
   checkCreate(ctx);
   switch (sig) {
     case _ARCHIVE_CREATE:
       return create(ctx);
     case _ARCHIVE_UPDATE:
       return update(ctx);
     case _ARCHIVE_DELETE:
       return delete(ctx);
     case _ARCHIVE_OPTIONS:
       return options(ctx);
     default:
       return super.item(ctx, ii);
   }
 }
Example #5
0
 @Override
 public Item item(final QueryContext qc, final InputInfo ii) throws QueryException {
   checkCreate(qc);
   try {
     final int id = (int) toLong(exprs[0], qc);
     final JDBCConnections jdbc = jdbc(qc);
     final Object obj = jdbc.get(id);
     if (obj instanceof Connection) {
       ((Connection) obj).close();
     } else {
       ((PreparedStatement) obj).close();
     }
     jdbc.remove(id);
     return null;
   } catch (final SQLException ex) {
     throw BXSQ_ERROR_X.get(info, ex);
   }
 }
Example #6
0
 /**
  * Performs the test function.
  *
  * @param ctx query context
  * @return resulting value
  * @throws QueryException query exception
  */
 private Item test(final QueryContext ctx) throws QueryException {
   checkCreate(ctx);
   return new Unit(ctx, info).test();
 }