Examples of ScalarHandler


Examples of com.bleujin.framework.db.bean.handlers.ScalarHandler

 
  }
 
  public void testScalar() throws Exception {
    Rows rows = dc.getRows(query, 10, 1) ;
    Object value = rows.toHandle(new ScalarHandler()) ;
   
    assertEquals("1", value.toString()) ;
   
   
    rows = dc.getRows(query, 10, 1) ;
    Object secondValue = rows.toHandle(new ScalarHandler(2)) ;
    assertEquals("01", secondValue) ;
  }
View Full Code Here

Examples of com.bleujin.framework.db.bean.handlers.ScalarHandler

  }


  public void xtestInsertBatch() throws Exception {

    Object obj = dc.createUserCommand("select max(a) from test").execQuery().toHandle(new ScalarHandler());
    int aMax = (Integer)obj ;
    System.out.println("current:" + aMax);

    // 1000 * 1000
    StopWatch watch = new StopWatch();
View Full Code Here

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

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

    @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
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.