Package org.apache.commons.dbutils.handlers

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


  public int queryCount(String sql,Object...params) throws SQLException {
   
    Connection conn = getConnection();
    Number num = null;
    try{
      num = (Number)queryRunner.query(conn, sql, new ScalarHandler(), params);
      return (num!=null)?num.intValue():-1;
    }catch(SQLException e){
      throw e;
    }finally{
      DBManager.closeConnection();
View Full Code Here


    @SuppressWarnings({ "unchecked", "rawtypes" })
  public Object findBy(String sql, String columnName, Object[] params) {  
        Object object = null
        try
            if (params == null) { 
                object = qr.query(sql, new ScalarHandler(columnName))
            } else
                object = qr.query(sql, new ScalarHandler(columnName), params)
           
        } catch (SQLException e) { 
            System.err.println("findBy������" +e)
       
        return object; 
View Full Code Here

TOP

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

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.