Examples of QueryRunner


Examples of org.apache.commons.dbutils.QueryRunner

   */
  public void createUser(String userName, String password)
    throws ControllerException {
   
    String sql = "create user " + userName + " set password '" + password + "'";
    QueryRunner queryRunner = new QueryRunner(DataSourceHandler.getDataSource());
   
    try {
     
      queryRunner.update(sql);
    } catch (SQLException se) {
      log.warning("SystemDBController: " + se.getMessage());
      throw new ControllerException(se);
    }
  }     
View Full Code Here

Examples of org.apache.commons.dbutils.QueryRunner

      sql += " set acount lock";
    } else {
      sql += " set acount unlock";
    }
     
    QueryRunner queryRunner = new QueryRunner(DataSourceHandler.getDataSource());
    ResultSetHandler rsh = new MapHandler();
    try {
      queryRunner.update(sql);
    } catch (SQLException se) {
      log.warning("SystemDBController: " + se.getMessage());
      throw new ControllerException(se);
    }
  }     
View Full Code Here

Examples of org.apache.commons.dbutils.QueryRunner

   
    if (groupList != null) {
      sql += " set groups '" + groupList +"'";
    }
   
    QueryRunner queryRunner = new QueryRunner(DataSourceHandler.getDataSource());
    ResultSetHandler rsh = new MapHandler();
    try {
      queryRunner.update(sql);
    } catch (SQLException se) {
      log.warning("SystemDBController: " + se.getMessage());
      throw new ControllerException(se);
    }
  }     
View Full Code Here

Examples of org.apache.commons.dbutils.QueryRunner

   */
  public void dropUser(String userName)
    throws ControllerException {
   
    String sql = "drop user " + userName;
    QueryRunner queryRunner = new QueryRunner(DataSourceHandler.getDataSource());
    try {
      queryRunner.update(sql);
    } catch (SQLException se) {
      log.warning("SystemDBController: " + se.getMessage());
      throw new ControllerException(se);
    }
  }
View Full Code Here

Examples of org.apache.commons.dbutils.QueryRunner

    } catch (SQLException se) {
      System.out.println(se.getMessage());
      return;
    }
   
    QueryRunner runner = new QueryRunner();
    ResultSetHandler rsh = new MapHandler();
    String sql = null;
    Map clientMap = null;
    Object obj = null;
   
    try {
      sql = "delete from Client where (ClientID=40)";
      obj = runner.query(conn, sql, null, rsh);
    } catch (SQLException se) {
      System.out.println(se.getMessage());
      return;
    }
   
    try {
      sql = "select * from Client where (ClientID=40)";
      clientMap = (Map) runner.query(conn, sql, null, rsh);
      DbUtils.close(conn);
    } catch (SQLException se) {
      System.out.println(se.getMessage());
      return;
    }
View Full Code Here

Examples of xbird.util.jdbc.QueryRunner

    public static QueryRunner create() {
        if(queryRunner != null)
            return queryRunner;
        DBAccessor dba = DBAccessorFactory.create();
        queryRunner = new QueryRunner(dba.getDataSource());
        return queryRunner;
    }
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.