Package org.apache.commons.dbutils.handlers

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


   */
  public int updateRecord(String tableName, String primaryKeyName, Map columnMap
    throws ControllerException, UpdaterException  {
   
    QueryRunner queryRunner = new QueryRunner();
    ResultSetHandler rsh = new MapHandler();
    String sql = null;

    try {
      sql = "select * from " + tableName;
      sql += " where (" + primaryKeyName + "=?)";
View Full Code Here


  public Map findDefaultContactDetails(int clientID)
    throws ControllerException  {
   
      DataSource dataSource = DataSourceHandler.getDataSource();
      QueryRunner queryRunner = new QueryRunner(dataSource);
      ResultSetHandler rsh = new MapHandler();
      String sql = null;

      try {
        sql = "select * from contact_detail INNER JOIN contact_type ON (contact_detail.contact_type_id=contact_type.contact_type_id)";
        sql += " where (";
View Full Code Here

  public List findInvoices(int clientID)
      throws ControllerException  {
   
    QueryRunner queryRunner = new QueryRunner(dataSource);
    ResultSetHandler mapListRsh = new MapListHandler();
    ResultSetHandler mapRsh = new MapHandler();
    String sql = null;
 
    try {
      // Get connection from the connection pool
      sql = "select * from invoice";
View Full Code Here

    DataSourceHandler.setUserName(userName);
    DataSourceHandler.setPassword(passWordInPlainText);
    DataSource dataSource = DataSourceHandler.getDataSource();
   
    QueryRunner queryRunner = new QueryRunner(dataSource);
    ResultSetHandler rshMap = new MapHandler();
    ResultSetHandler rshList = new MapListHandler();

    try {
      String sql =
        "select * from person" + " where (" + " (user_name=?)" + " )";
View Full Code Here

   */
  public static void logoffPerson() {

    DataSource dataSource = DataSourceHandler.getDataSource();
    QueryRunner queryRunner = new QueryRunner(dataSource);
    ResultSetHandler rshMap = new MapHandler();

    try {
      String sql =
        "update login"
          + " set logoff_date=CURRENT_TIMESTAMP"
View Full Code Here

      System.out.println(se.getMessage());
      return;
    }
   
    QueryRunner runner = new QueryRunner();
    ResultSetHandler rsh = new MapHandler();
    String sql = null;
    Map clientMap = null;
    Object obj = null;
   
    try {
View Full Code Here

  public static Map<String, Object> getById(Connection conn,String sql,
      Object[] params) {
    Map<String, Object> map = null;
    try {
      if (params == null) {
        map = qr.query(conn, sql, new MapHandler());
      } else {
        map = qr.query(conn, sql, new MapHandler(), params);
      }
    } catch (Exception e) {
      System.err.println("��ѯ�����쳣!ԭ��:" + e);
    }
    return map;
View Full Code Here

     */ 
    public Map<String, Object> findFirst(String sql, Object[] params) {  
        Map<String, Object> map = null
        try
            if (params == null) { 
                map = (Map<String, Object>) qr.query(sql, new MapHandler())
            } else
                map = (Map<String, Object>) qr.query(sql, new MapHandler(), params)
           
        } catch (SQLException e) {  
            System.err.println("findFirst.��ѯһ����¼����" + e)
       
        return map; 
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.