Package org.apache.commons.dbutils

Examples of org.apache.commons.dbutils.QueryRunner


  }
 
  public void updateProcessLog(String logValue, int processId) throws SQLException {
    Connection connection = helper.getConnection();
    try {
      QueryRunner run = new QueryRunner();
      StringBuilder sql = new StringBuilder();
      Object[] param = { logValue, processId };
      sql.append("UPDATE prozesse SET wikifield = ? WHERE ProzesseID = ?");
      logger.debug(sql.toString() + ", " + param);
      run.update(connection, sql.toString(), param);
    } finally {
      closeConnection(connection);
    }
  }
View Full Code Here


    StringBuilder sql = new StringBuilder();
    sql.append("SELECT * FROM projekte WHERE ProjekteID = ?");
    try {
      Object[] param = { projectId };
      logger.debug(sql.toString() + ", " + param);
      ProjectObject answer = new QueryRunner().query(connection, sql.toString(), MySQLUtils.resultSetToProjectHandler, param);
      return answer;
    } finally {
      closeConnection(connection);
    }
  }
View Full Code Here

    sql.append("SELECT * FROM projectfilegroups WHERE ProjekteID = ? ");
    try {
      Object[] param = { projectId };
      logger.debug(sql.toString() + ", " + param);
      List<ProjectFileGroup> answer = new QueryRunner().query(connection, sql.toString(), MySQLUtils.resultSetToProjectFilegroupListHandler,
          param);
      return answer;

    } finally {
      closeConnection(connection);
View Full Code Here

    StringBuilder sql = new StringBuilder();
    sql.append("SELECT * FROM benutzereigenschaften WHERE Titel = '_filter' AND BenutzerID = ?");
    try {
      Object[] param = { userId };
      logger.debug(sql.toString() + ", " + param);
      List<String> answer = new QueryRunner().query(connection, sql.toString(), MySQLUtils.resultSetToFilterListtHandler, param);
      return answer;
    } finally {
      closeConnection(connection);
    }
  } 
View Full Code Here

 
  public static void addFilterToUser(int userId, String filterstring) throws SQLException {
    Connection connection = helper.getConnection();
    Timestamp datetime = new Timestamp(new Date().getTime());
    try {
      QueryRunner run = new QueryRunner();
      String propNames = "Titel, Wert, IstObligatorisch, DatentypenID, Auswahl, creationDate, BenutzerID";
      Object[] param = { "_filter", filterstring, false, 5, null, datetime, userId };
      String sql = "INSERT INTO " + "benutzereigenschaften" + " (" + propNames + ") VALUES ( ?, ?,? ,? ,? ,?,? )";
      logger.debug(sql.toString() + ", " + param);
      run.update(connection, sql, param);
    } finally {
      closeConnection(connection);
    }
  }
View Full Code Here

  }

  public static void removeFilterFromUser(int userId, String filterstring) throws SQLException {
    Connection connection = helper.getConnection();
    try {
      QueryRunner run = new QueryRunner();
      Object[] param = { userId, filterstring };
      String sql = "DELETE FROM benutzereigenschaften WHERE Titel = '_filter' AND BenutzerID = ? AND Wert = ?";
      logger.debug(sql.toString() + ", " + param);
      run.update(connection, sql, param);
    } finally {
      closeConnection(connection);
    }
  }
View Full Code Here

  }

  public static List<Integer> getStepIds(String query) throws SQLException {
    Connection connection = helper.getConnection();
    try {
      return new QueryRunner().query(connection, query, MySQLUtils.resultSetToIntegerListHandler);
    } finally {
      closeConnection(connection);
    }
  }
View Full Code Here

    Connection connection = helper.getConnection();

    String query = "select count(ProzesseID) from prozesse where MetadatenKonfigurationID = ?";
    try {
      Object[] param = { rulesetId };
      return new QueryRunner().query(connection, query, MySQLUtils.resultSetToIntegerHandler, param);
    } finally {
      closeConnection(connection);
    }
  }
View Full Code Here

  public static int getCountOfProcessesWithDocket(int docketId) throws SQLException {
    Connection connection = helper.getConnection();
    String query = "select count(ProzesseID) from prozesse where  docketID= ?";
    try {
      Object[] param = { docketId };
      return new QueryRunner().query(connection, query, MySQLUtils.resultSetToIntegerHandler, param);
    } finally {
      closeConnection(connection);
    }
  }
View Full Code Here

  public static int getCountOfProcessesWithTitle(String title) throws SQLException {
    Connection connection = helper.getConnection();
    String query = "select count(ProzesseID) from prozesse where  titel = ?";
    try {
      Object[] param = { title };
      return new QueryRunner().query(connection, query, MySQLUtils.resultSetToIntegerHandler, param);
    } finally {
      closeConnection(connection);
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.commons.dbutils.QueryRunner

Copyright © 2018 www.massapicom. 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.