Package org.springframework.jdbc.core

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


      public Void doInTransaction(TransactionStatus status) {
        template.queryForList("select ham from foo");
        tt2.execute(new TransactionCallback<Void>() {
          @Override
          public Void doInTransaction(TransactionStatus status) {
            template.queryForList("select 1 from eggs");
            return null;
          }
        });
        template.queryForList("select more, ham from foo");
        return null;
View Full Code Here


          public Void doInTransaction(TransactionStatus status) {
            template.queryForList("select 1 from eggs");
            return null;
          }
        });
        template.queryForList("select more, ham from foo");
        return null;
      }
    });
    tt.execute(new TransactionCallback<Void>() {
      @Override
View Full Code Here

      }
    });
    tt.execute(new TransactionCallback<Void>() {
      @Override
      public Void doInTransaction(TransactionStatus status) {
        template.queryForList("select spam from ham");
        return null;
      }
    });
    csds.stopCloseSuppression(connection);
    DataSourceUtils.releaseConnection(connection, csds);
View Full Code Here

        return null;
      }
    });
    csds.stopCloseSuppression(connection);
    DataSourceUtils.releaseConnection(connection, csds);
    template.queryForList("select egg from bar");

  }

  @Test(expected = IllegalArgumentException.class)
  public void delegateIsRequired() throws Exception {
View Full Code Here

   
    this.connUtil.doWork(new DbWork() {
      @Override
      public void execute(Connection conn) {
        JdbcTemplate jt = JuConnUtils.asJdbcTemplate(conn);
        res.setValue(jt.queryForList(sql, listType));
      }
    });
   
    return res.getValue();
  }
View Full Code Here

      @Override
      public void execute(Connection conn) {
        JdbcTemplate jt = JuConnUtils.asJdbcTemplate(conn);
       
        // Reset autoincrement values
        List<Map<String, Object>> res = jt.queryForList("select c.TABLE_NAME, c.COLUMN_NAME " +
          "from information_schema.columns c " +
          "where c.EXTRA='auto_increment'"); //c.TABLE_NAME='Player'"
               
        for (Map<String, Object> row : res) {
          String tableName = row.get("TABLE_NAME").toString();
View Full Code Here

   */
  public List<DatabaseUpdateDO> getUpdateHistory()
  {
    accessCheck(false);
    final JdbcTemplate jdbc = new JdbcTemplate(getDataSource());
    final List<Map<String, Object>> dbResult = jdbc.queryForList("select * from t_database_update order by update_date desc");
    final List<DatabaseUpdateDO> result = new ArrayList<DatabaseUpdateDO>();
    for (final Map<String, Object> map : dbResult) {
      final DatabaseUpdateDO entry = new DatabaseUpdateDO();
      entry.setUpdateDate((Date) map.get("update_date"));
      entry.setRegionId((String) map.get("region_id"));
View Full Code Here

        assertFalse(userService.read(3L).getResources().contains(RESOURCE_NAME_TESTDB2));
        assertFalse(userService.read(4L).getResources().contains(RESOURCE_NAME_TESTDB2));
        assertTrue(userService.read(5L).getResources().contains(RESOURCE_NAME_TESTDB2));

        final JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
        assertEquals(0, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='puccini'").size());

        // ------------------------------------------
        // Unmatching --> Assign --> dryRuyn
        // ------------------------------------------
        execSyncTask(13L, 50, true);
View Full Code Here

        // ------------------------------------------
        // Unmatching --> Assign --> dryRuyn
        // ------------------------------------------
        execSyncTask(13L, 50, true);
        assertEquals(0, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='vivaldi'").size());
        assertFalse(userService.read(3L).getResources().contains(RESOURCE_NAME_TESTDB2));
        // ------------------------------------------

        final Set<Long> pushTaskIds = new HashSet<Long>();
        pushTaskIds.add(13L);
View Full Code Here

        execSyncTasks(pushTaskIds, 50, false);

        // ------------------------------------------
        // Unatching --> Ignore
        // ------------------------------------------
        assertEquals(1, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='verdi'").size());
        assertFalse(userService.read(2L).getResources().contains(RESOURCE_NAME_TESTDB2));
        // ------------------------------------------

        // ------------------------------------------
        // Unmatching --> Assign
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.