Examples of QueryRunner


Examples of com.iCo6.util.org.apache.commons.dbutils.QueryRunner

        }

        Thrun.init(new Runnable() {
            public void run() {
                try {
                    QueryRunner run = new QueryRunner();
                    Connection c = iConomy.Database.getConnection();

                    try {
                        String t = Constants.Nodes.DatabaseTable.toString();
                        Integer amount = run.update(c, "TRUNCATE TABLE " + t);
                    } catch (SQLException ex) {
                        System.out.println("[iConomy] Error issueing SQL query: " + ex);
                    } finally {
                        DbUtils.close(c);
                    }
View Full Code Here

Examples of com.iCo6.util.org.apache.commons.dbutils.QueryRunner

        if (useOrbDB())
            return (iConomy.Server.getPlayer(name) != null) ? 1 : (database.hasIndex(name)) ? database.getArguments(name).getInteger("status") : 0;

        try {
            QueryRunner run = new QueryRunner();
            Connection c = iConomy.Database.getConnection();

            try{
                String t = Constants.Nodes.DatabaseTable.toString();
                status = run.query(c, "SELECT status FROM " + t + " WHERE username=?", returnStatus, name.toLowerCase());
            } catch (SQLException ex) {
                System.out.println("[iConomy] Error issueing SQL query: " + ex);
            } finally {
                DbUtils.close(c);
            }
View Full Code Here

Examples of com.iCo6.util.org.apache.commons.dbutils.QueryRunner

            return;
        }

        try {
            QueryRunner run = new QueryRunner();
            Connection c = iConomy.Database.getConnection();

            try{
                String t = Constants.Nodes.DatabaseTable.toString();
                int update = run.update(c, "UPDATE " + t + " SET status=? WHERE username=?", status, name.toLowerCase());
            } catch (SQLException ex) {
                System.out.println("[iConomy] Error issueing SQL query: " + ex);
            } finally {
                DbUtils.close(c);
            }
View Full Code Here

Examples of com.iCo6.util.org.apache.commons.dbutils.QueryRunner

    public boolean tableExists(String table) {
        boolean exists = false;

        try {
            Connection conn = getConnection();
            QueryRunner run = new QueryRunner();

            try {
                String t = Constants.Nodes.DatabaseTable.toString();
                exists = run.query(conn, "SELECT id FROM " + table, returnBoolean);
            finally {
                DbUtils.close(conn);
            }
        } catch (SQLException e) {
            exists = false;
View Full Code Here

Examples of com.iCo6.util.org.apache.commons.dbutils.QueryRunner

            return accounts;
        }

        try {
            QueryRunner run = new QueryRunner();
            Connection c = iConomy.Database.getConnection();

            try{
                String t = Constants.Nodes.DatabaseTable.toString();
                accounts = run.query(c, "SELECT username FROM " + t, returnList);
            } catch (SQLException ex) {
                System.out.println("[iConomy] Error issueing SQL query: " + ex);
            } finally {
                DbUtils.close(c);
            }
View Full Code Here

Examples of com.iCo6.util.org.apache.commons.dbutils.QueryRunner

                    total.add(p.getName());

            total.addAll(database.getIndices().keySet());
        } else {
            try {
                QueryRunner run = new QueryRunner();
                Connection c = iConomy.Database.getConnection();

                try{
                    String t = Constants.Nodes.DatabaseTable.toString();
                    total = run.query(c, "SELECT username FROM " + t + " WHERE status <> 1 ORDER BY balance DESC LIMIT " + amount, returnList);
                } catch (SQLException ex) {
                    System.out.println("[iConomy] Error issueing SQL query: " + ex);
                } finally {
                    DbUtils.close(c);
                }
View Full Code Here

Examples of common.db.QueryRunner

    new TestMain().run();
  }

  public void deleteMultyByNumber(Integer[] indexDelete)
  {
    QueryRunner queryRunner = new QueryRunner(dbParam);

    for(Integer i : indexDelete)
    {
      queryRunner.update(sqlRes.query("deleteMultyByNumber"), i);
    }

  }
View Full Code Here

Examples of io.druid.query.QueryRunner

          new TimeseriesQueryQueryToolChest(new QueryConfig()),
          new TimeseriesQueryEngine(),
          QueryRunnerTestHelper.NOOP_QUERYWATCHER
      );

      QueryRunner runner = new FinalizeResultsQueryRunner(
          factory.createRunner(segment),
          factory.getToolchest()
      );

      TestHelper.assertExpectedResults(expectedResults, runner.run(query, Maps.newHashMap()));
    }
    catch (Exception e) {
      throw Throwables.propagate(e);
    }
  }
View Full Code Here

Examples of ivory.smrf.retrieval.QueryRunner

    mNumHits = numHits;
  }

  public void runQueries() throws Exception {
    // initialize retrieval environment variables
    QueryRunner runner = null;
    try {
      runner = new BrokerQueryRunner(mBrokerAddress);
    } catch (Exception e) {
      e.printStackTrace();
    }

    for (String qid : mQueries.keySet()) {
      String rawQueryText = mQueries.get(qid);
      sLogger.info("query id:" + qid + ", query text:" + rawQueryText);
      runner.runQuery(qid, rawQueryText.split("\\s+"));
    }

    // where should we output these results?
    ResultWriter resultWriter = null;
    resultWriter = getResultWriter(mOutputFile, false);
View Full Code Here

Examples of net.sourceforge.processdash.tool.db.QueryRunner

     * @param dbCriteria the criteria to use against the database
     * @param t the analysis task to run
     */
    public static void run(DatabasePlugin plugin, List dbCriteria,
            DefectAnalyzer.Task t) {
        QueryRunner queryRunner = plugin.getObject(QueryRunner.class);
        if (queryRunner == null)
            return;

        StringBuilder query = new StringBuilder(DEFECT_HQL_QUERY);
        List args = QueryUtils.addCriteriaToHql(query, "d", null, dbCriteria);

        List<DefectToAnalyze> defects = new ArrayList();
        List<Object[]> rawData = queryRunner.queryHql(query.toString(),
            args.toArray());
        for (Object[] oneRow : rawData) {
            String path = getDefectPathFromHqlResultRow(oneRow);
            Defect d = getDefectFromHqlResultRow(oneRow);
            defects.add(new DefectToAnalyze(path, d));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.