Examples of query()


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

    }

    private Object[] getParameters(final String tableName, final Attributes attrs) {
        JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);

        Map<String, Integer> colTypes = jdbcTemplate.query("SELECT * FROM " + tableName,
                new ResultSetExtractor<Map<String, Integer>>() {

            @Override
            public Map<String, Integer> extractData(final ResultSet rs) throws SQLException, DataAccessException {
                Map<String, Integer> colTypes = new HashMap<String, Integer>();
View Full Code Here

Examples of org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations.query()

        .addTimestamp("version_as_of_instant", Objects.firstNonNull(versionAsOf, now))
        .addTimestamp("corrected_to_instant", Objects.firstNonNull(correctedTo, now));
    final PortfolioDocumentExtractor extractor = new PortfolioDocumentExtractor(true, false);
    final NamedParameterJdbcOperations namedJdbc = getDbConnector().getJdbcTemplate();
    final String sql = getElSqlBundle().getSql("GetNodeByOidInstants", args);
    final List<PortfolioDocument> docs = namedJdbc.query(sql, args, extractor);
    if (docs.isEmpty()) {
      throw new DataNotFoundException("Node not found: " + uniqueId);
    }
    return docs.get(0).getPortfolio().getRootNode(); // SQL loads desired node in place of the root node
  }
View Full Code Here

Examples of org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.query()

            return new StreamingStatementCreator(originalCreator);
          }

        };
        final AtomicInteger rowNum = new AtomicInteger(0);
        template.query(sql, params, new RowCallbackHandler() {

          @Override
          public void processRow(ResultSet rs) throws SQLException {
            handler.handleRow(mapper.mapRow(rs, rowNum.incrementAndGet()));
          }
View Full Code Here

Examples of org.springframework.jdbc.core.simple.SimpleJdbcTemplate.query()

    */
   public String getPortalUserName(final int uPortalUID) {
       final DataSource dataSource = RDBMServices.getDataSource();
       final SimpleJdbcTemplate simpleJdbcTemplate = new SimpleJdbcTemplate(dataSource);

       final List<String> results = simpleJdbcTemplate.query("SELECT USER_NAME FROM UP_USER WHERE USER_ID=?", this.userNameRowMapper, uPortalUID);
       final String userName = (String)DataAccessUtils.singleResult(results);
       return userName;
   }
  
   private final UserNameRowMapper userNameRowMapper = new UserNameRowMapper();
View Full Code Here

Examples of org.springframework.web.util.UriComponentsBuilder.query()

        String port = m.group(10);
        if (!Strings.isNullOrEmpty(port)) {
          builder.port(Integer.parseInt(port));
        }
        builder.path(m.group(11));
        builder.query(m.group(13));
        builder.fragment(m.group(15)); // we throw away the hash, but this is the group it would be if we kept it
      } else {
        // doesn't match the pattern, throw it out
        logger.warn("Parser couldn't match input: " + identifier);
        return null;
View Full Code Here

Examples of org.springframework.xd.test.fixtures.JdbcSource.query()

    String streamname = generateStreamName().replace("-", "_");

    jdbcSource.getJdbcTemplate().update(String.format("create table %s (seen INT, name VARCHAR(32))", streamname));
    jdbcSource.getJdbcTemplate().update(String.format("insert into %s (seen, name) values (0, 'eric')", streamname));
    jdbcSource.getJdbcTemplate().update(String.format("insert into %s (seen, name) values (0, 'eric')", streamname));
    jdbcSource.query(String.format("SELECT * FROM %s", streamname));

    stream().create(streamname, "%s | %s", jdbcSource, counter);
    assertThat(counter, XDMatchers.eventually(XDMatchers.hasValue("2")));
    jdbcSource.getJdbcTemplate().update(String.format("insert into %s (seen, name) values (0, 'eric')", streamname));
    assertThat(counter, XDMatchers.eventually(XDMatchers.hasValue("" + (2 + 3))));
View Full Code Here

Examples of org.teiid.translator.salesforce.SalesforceConnection.query()

    qr.setDone(false);
    QueryResult finalQr = new QueryResult();
    so.getAny().add(elem);
    finalQr.getRecords().add(so);
    finalQr.setDone(true);
    Mockito.stub(sfc.query("SELECT Account.AccountName FROM Account", 0, false)).toReturn(qr);
    Mockito.stub(sfc.queryMore(null, 0)).toReturn(finalQr);
    QueryExecutionImpl qei = new QueryExecutionImpl(command, sfc, Mockito.mock(RuntimeMetadata.class), Mockito.mock(ExecutionContext.class));
    qei.execute();
    assertNotNull(qei.next());
    assertNotNull(qei.next());
View Full Code Here

Examples of org.terrier.querying.parser.TerrierQueryParser.query()

            selector.addInputStream(lexer, "main");
            selector.addInputStream(flexer, "numbers");
            selector.select("main");
            TerrierQueryParser parser = new TerrierQueryParser(selector);
            parser.setSelector(selector);
            rtr = parser.query();
        }catch (Exception e) {
           // throw new QueryParserException("Failed to process '"+query+"'",e);
        }
    if (rtr == null)
    {
View Full Code Here

Examples of org.wso2.carbon.registry.indexing.solr.SolrClient.query()

    public SearchResultsBean searchContent(String searchQuery,
                              UserRegistry registry) throws IndexerException, RegistryException {
        SearchResultsBean resultsBean = new SearchResultsBean();
        SolrClient client = SolrClient.getInstance();
        SolrDocumentList results = client.query(searchQuery, registry.getTenantId());

        if (log.isDebugEnabled()) log.debug("result received "+ results);

        List<ResourceData> filteredResults = new ArrayList<ResourceData>();
        for (int i = 0;i < results.getNumFound();i++){
View Full Code Here

Examples of org.xmldb.api.modules.XPathQueryService.query()

        try {
            XPathQueryService service =
                (XPathQueryService) collection.getService("XPathQueryService", "1.0");
            ResourceSet resultSet = (resource == null) ?
                    service.query(query) : service.queryResource(resource, query);

            attributes.addAttribute("", QUERY_ATTR, QUERY_ATTR, "CDATA", query);
            attributes.addAttribute("", RESULTS_COUNT_ATTR,
                    RESULTS_COUNT_ATTR, "CDATA", Long.toString(resultSet.getSize()));
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.