Examples of queryForLong()


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

    String sql = "SELECT COUNT(0) FROM BAR";
    long expectedResult = 666;

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

    SimpleJdbcTemplate jth = new SimpleJdbcTemplate(jo);
    long result = jth.queryForLong(sql);
View Full Code Here

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

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

    MockControl mc = MockControl.createControl(JdbcOperations.class);
    JdbcOperations jo = (JdbcOperations) mc.getMock();
    jo.queryForLong(sql, new Object[]{arg1, arg2, arg3});
    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.queryForLong()

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

    MockControl mc = MockControl.createControl(JdbcOperations.class);
    JdbcOperations jo = (JdbcOperations) mc.getMock();
    jo.queryForLong(sql, new Object[]{arg1, arg2, arg3});
    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.queryForLong()

    String sql = "SELECT COUNT(0) FROM BAR";
    long expectedResult = 666;

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

    SimpleJdbcTemplate jth = new SimpleJdbcTemplate(jo);
    long result = jth.queryForLong(sql);
View Full Code Here

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

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

    MockControl mc = MockControl.createControl(JdbcOperations.class);
    JdbcOperations jo = (JdbcOperations) mc.getMock();
    jo.queryForLong(sql, new Object[]{arg1, arg2, arg3});
    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.queryForLong()

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

    MockControl mc = MockControl.createControl(JdbcOperations.class);
    JdbcOperations jo = (JdbcOperations) mc.getMock();
    jo.queryForLong(sql, new Object[]{arg1, arg2, arg3});
    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.queryForLong()

    JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
    jdbcTemplate.execute("create table MY_TABLE (MY_TEXT varchar);");
   
    // The hello() method will start the process. The process will wait in a user task
    userBean.hello();
    assertEquals(0, jdbcTemplate.queryForLong("select count(*) from MY_TABLE"));
   
    // The completeTask() method will write a record to the 'MY_TABLE' table and complete the user task
    try {
      userBean.completeTask(taskService.createTaskQuery().singleResult().getId());
      fail();
View Full Code Here

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

    } catch (Exception e) { }
   
    // Since the service task after the user tasks throws an exception, both
    // the record and the process must be rolled back !
    assertEquals("My Task", taskService.createTaskQuery().singleResult().getName());
    assertEquals(0, jdbcTemplate.queryForLong("select count(*) from MY_TABLE"));
   
    // Cleanup
    jdbcTemplate.execute("drop table MY_TABLE if exists;");
  }
 
View Full Code Here

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

        // Create new test table
        jt.execute("CREATE TABLE juConnUtilTestTable (id NUMERIC(19))");
        jt.execute("insert into juConnUtilTestTable (id) values (1)");
       
        // Query the table
        Long id = jt.queryForLong("select id from juConnUtilTestTable where id=1");
        Assert.assertEquals(new Long(1), id);
       
        // Create a new connUtil to make sure we'll see the changes there...
        JuConnUtil connUtil2 = JuConnUtils.build()
          .profile(JuUtils.getJuPropertyChain().get("ju-dbutil-test.profile", true))
View Full Code Here

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

        JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
        jdbcTemplate.execute("create table MY_TABLE (MY_TEXT varchar);");

        // The hello() method will start the process. The process will wait in a user task
        userBean.hello();
        assertEquals(0, jdbcTemplate.queryForLong("select count(*) from MY_TABLE"));

        // The completeTask() method will write a record to the 'MY_TABLE' table and complete the user task
        try {
            userBean.completeTask(taskService.createTaskQuery().singleResult().getId());
            fail();
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.