Package org.apache.commons.dbutils.handlers

Examples of org.apache.commons.dbutils.handlers.MapHandler


  public void updateRecord(String tableName, String primaryKeyName, Map columnMap
  throws ControllerException  {
   
    Connection conn = null;
    QueryRunner queryRunner = new QueryRunner(dataSource);
    ResultSetHandler rsh = new MapHandler();
    String sql = null;

    try {
      conn = dataSource.getConnection();
      conn.setAutoCommit(false)// Start transaction
View Full Code Here


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

    } 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

    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

   
    // Create user in system database as well.
    String sql = "select * from SYS_INFO.sUSRPassword";
    sql += " where (UserName='" + userName + "')";
    QueryRunner queryRunner = new QueryRunner(DataSourceHandler.getDataSource());
    ResultSetHandler rsh = new MapHandler();

    try {
      return (Map) queryRunner.query(sql, rsh);
    } catch (SQLException se) {
      log.warning("SystemDBController: " + se.getMessage());
View Full Code Here

   */
  public Map findWhere(String tableName, String whereClause)
    throws ControllerException, FinderException {

    QueryRunner queryRunner = new QueryRunner(dataSource);
    ResultSetHandler rsh = new MapHandler();
    String sql = null;

    try {
      sql = "SELECT * FROM " + tableName;

View Full Code Here

    String whereClause,
    Object[] params)
    throws ControllerException {

    QueryRunner queryRunner = new QueryRunner(dataSource);
    ResultSetHandler rsh = new MapHandler();
    String sql = null;

    try {
      sql = "SELECT * FROM " + tableName;

View Full Code Here

    Map columnMap)
    throws ControllerException, UpdaterException {

    Connection conn = null;
    QueryRunner queryRunner = new QueryRunner(dataSource);
    ResultSetHandler rsh = new MapHandler();
    String sql = null;

    try {
      conn = dataSource.getConnection();
      conn.setAutoCommit(false); // Start transaction
View Full Code Here

    if (!isDefault) {
      return;
    }

    QueryRunner queryRunner = new QueryRunner(dataSource);
    ResultSetHandler rsh = new MapHandler();
    String sql = null;
    sql = "select * from " + tableName;
    sql += " where (";
    sql += " (is_default=true)";

View Full Code Here

 
  public void go() {
   
    DataSource dataSource= DataSourceHandler.getDataSource();
    QueryRunner runner = new QueryRunner(dataSource);
    ResultSetHandler rsh = new MapHandler();
    String sql = "select * from Client where (ClientID=1)";
    Map clientMap = null;
    try {
      clientMap = (Map) runner.query(sql, null, rsh);
    } catch (SQLException se) {
View Full Code Here

TOP

Related Classes of org.apache.commons.dbutils.handlers.MapHandler

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.