Package org.apache.commons.dbutils

Examples of org.apache.commons.dbutils.ResultSetHandler


  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 static void loadParameters() {

      QueryRunner queryRunner = new QueryRunner(DataSourceHandler.getDataSource());
      ResultSetHandler rsh = new MapListHandler();
      String sql = "select * from parameter";
     
      try {
        parameterMap = (Map) queryRunner.query(sql, rsh);
      } catch (SQLException se) {
View Full Code Here

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

    String orderClause,
    String whereClause)
    throws ControllerException {

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

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

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

TOP

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

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.