Examples of queryForObject()


Examples of com.ibatis.sqlmap.client.SqlMapClient.queryForObject()

          .getResourceAsStream("SqlMapConfig.xml"));
      client = Utils.getSqlMapClient(input);
     
      FileModel model = null;
      recid = Integer.valueOf(req.getParameter("recid"));
      model= (FileModel) client.queryForObject("getModel",recid);
      if(model != null){
        List<DrawModel> draws = client.queryForList("getDraws",recid);
        model.setDraws(draws);
      }         
     
View Full Code Here

Examples of com.ibatis.sqlmap.client.SqlMapSession.queryForObject()

    clientControl.setReturnValue(session, 1);
    session.getCurrentConnection();
    sessionControl.setReturnValue(null, 1);
    session.setUserConnection(con);
    sessionControl.setVoidCallable(1);
    session.queryForObject("myStatement", "myParameter");
    sessionControl.setReturnValue("myResult", 1);
    session.close();
    sessionControl.setVoidCallable(1);

    dsControl.replay();
View Full Code Here

Examples of liquibase.executor.Executor.queryForObject()

            database.commit();
        }

        if (executor.updatesDatabase() && database instanceof DerbyDatabase && ((DerbyDatabase) database).supportsBooleanDataType()) { //check if the changelog table is of an old smallint vs. boolean format
            String lockTable = database.escapeTableName(database.getLiquibaseCatalogName(), database.getLiquibaseSchemaName(), database.getDatabaseChangeLogLockTableName());
            Object obj = executor.queryForObject(new RawSqlStatement("select min(locked) as test from " + lockTable + " fetch first row only"), Object.class);
            if (!(obj instanceof Boolean)) { //wrong type, need to recreate table
                executor.execute(new DropTableStatement(database.getLiquibaseCatalogName(), database.getLiquibaseSchemaName(), database.getDatabaseChangeLogLockTableName(), false));
                executor.execute(new CreateDatabaseChangeLogLockTableStatement());
                executor.execute(new InitializeDatabaseChangeLogLockTableStatement());
            }
View Full Code Here

Examples of org.g4studio.common.dao.Dao.queryForObject()

    dto.put("methodname", request.getParameter("reqCode"));
    dto.put("eventid", IDHelper.getEventID());
    dto.put("costtime", costTime);
    if (G4Utils.isNotEmpty(menuid)) {
      Dao g4Dao = (Dao) SpringBeanLoader.getSpringBean("g4Dao");
      String menuname = ((BaseDto) g4Dao.queryForObject("Resource.queryEamenuByMenuID", menuid)).getAsString("menuname");
      String msg = userInfo.getUsername() + "[" + userInfo.getAccount() + "]打开了菜单[" + menuname + "]";
      dto.put("description", msg);
      log.info(msg);
    } else {
      String msg = userInfo.getUsername() + "[" + userInfo.getAccount() + "]调用了Action方法["
View Full Code Here

Examples of org.g4studio.common.dao.Reader.queryForObject()

   * @return Dto
   */
  public Dto queryBalanceInfo(String jsbh) {
    Reader reader = (Reader) SpringBeanLoader.getSpringBean("g4Reader");
    Dto inDto = new BaseDto("sxh", jsbh);
    Dto outDto = (BaseDto)reader.queryForObject("Demo.queryBalanceInfo", inDto);
    return outDto;
  }

}
View Full Code Here

Examples of org.springframework.jdbc.core.JdbcOperations.queryForObject()

    String sql = "SELECT SYSDATE FROM DUAL";
    Date expectedResult = new Date();

    MockControl mc = MockControl.createControl(JdbcOperations.class);
    JdbcOperations jo = (JdbcOperations) mc.getMock();
    jo.queryForObject(sql, Date.class);
    mc.setReturnValue(expectedResult);
    mc.replay();

    SimpleJdbcTemplate jth = new SimpleJdbcTemplate(jo);
    Date result = jth.queryForObject(sql, Date.class);
View Full Code Here

Examples of org.springframework.jdbc.core.JdbcOperations.queryForObject()

    String arg2 = "foo";
    Object arg3 = new Object();

    MockControl mc = MockControl.createControl(JdbcOperations.class);
    JdbcOperations jo = (JdbcOperations) mc.getMock();
    jo.queryForObject(sql, new Object[]{arg1, arg2, arg3}, Date.class);
    mc.setDefaultMatcher(new ArrayMatcher());
    mc.setReturnValue(expectedResult);
    mc.replay();

    SimpleJdbcTemplate jth = new SimpleJdbcTemplate(jo);
View Full Code Here

Examples of org.springframework.jdbc.core.JdbcOperations.queryForObject()

    String arg2 = "foo";
    Object arg3 = new Object();

    MockControl mc = MockControl.createControl(JdbcOperations.class);
    JdbcOperations jo = (JdbcOperations) mc.getMock();
    jo.queryForObject(sql, new Object[]{arg1, arg2, arg3}, Date.class);
    mc.setDefaultMatcher(new ArrayMatcher());
    mc.setReturnValue(expectedResult);
    mc.replay();

    SimpleJdbcTemplate jth = new SimpleJdbcTemplate(jo);
View Full Code Here

Examples of org.springframework.jdbc.core.JdbcOperations.queryForObject()

    String arg2 = "foo";
    Object arg3 = new Object();

    MockControl mc = MockControl.createControl(JdbcOperations.class);
    JdbcOperations jo = (JdbcOperations) mc.getMock();
    jo.queryForObject(sql, new Object[]{arg1, arg2, arg3}, Date.class);
    mc.setDefaultMatcher(new ArrayMatcher());
    mc.setReturnValue(expectedResult);
    mc.replay();

    SimpleJdbcTemplate jth = new SimpleJdbcTemplate(jo);
View Full Code Here

Examples of org.springframework.jdbc.core.JdbcTemplate.queryForObject()

        assertEquals("active", userTO.getStatus());
        assertEquals(Collections.singleton("resource-testdb"), userTO.getResources());

        exception = null;
        try {
            final String username = jdbcTemplate.queryForObject("SELECT id FROM test WHERE id=?", String.class, userTO.
                    getUsername());
            assertEquals(userTO.getUsername(), username);
        } catch (EmptyResultDataAccessException e) {
            exception = e;
        }
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.