Examples of RowCallbackHandler


Examples of org.springframework.jdbc.core.RowCallbackHandler

            ejt.query(
                    "select min(rd.ts), max(rd.ts) " //
                            + "from reportInstancePoints rp "
                            + "  join reportInstanceData rd on rp.id=rd.reportInstancePointId "
                            + "where rp.reportInstanceId=?", new Object[] { instance.getId() },
                    new RowCallbackHandler() {
                        @Override
                        public void processRow(ResultSet rs) throws SQLException {
                            if (instance.isFromInception())
                                instance.setReportStartTime(rs.getLong(1));
                            if (instance.isToNow())
View Full Code Here

Examples of org.springframework.jdbc.core.RowCallbackHandler

            handler.startPoint(point);

            edv.setReportPointId(point.getReportPointId());
            final int dataType = point.getDataType();
            ejt.query(REPORT_INSTANCE_DATA_SELECT + "where rd.reportInstancePointId=? order by rd.ts",
                    new Object[] { point.getReportPointId() }, new RowCallbackHandler() {
                        @Override
                        public void processRow(ResultSet rs) throws SQLException {
                            switch (dataType) {
                            case (DataTypes.NUMERIC):
                                edv.setValue(new NumericValue(rs.getDouble(1)));
View Full Code Here

Examples of org.springframework.jdbc.core.RowCallbackHandler

    public List<EventInstance> getReportInstanceEvents(int instanceId) {
        // Get the events.
        final List<EventInstance> events = query(EVENT_SELECT, new Object[] { instanceId },
                new EventDao.EventInstanceRowMapper());
        // Add in the comments.
        ejt.query(EVENT_COMMENT_SELECT, new Object[] { instanceId, UserComment.TYPE_EVENT }, new RowCallbackHandler() {
            @Override
            public void processRow(ResultSet rs) throws SQLException {
                // Create the comment
                UserComment c = new UserComment();
                c.setUsername(rs.getString(1));
View Full Code Here

Examples of org.springframework.jdbc.core.RowCallbackHandler

    /* SQL SELECT statement
     *
     */
    String selectSQL="SELECT * FROM Employee ORDER BY Employee.FirstName";
    System.out.println("Select from table...");
    template.query( selectSQL, new RowCallbackHandler() {
      public void processRow(ResultSet rs) throws SQLException
      {
        System.out.println("FirstName : " + rs.getString("FirstName"));
        System.out.println("LastName : "+rs.getString("LastName"));
      }
View Full Code Here

Examples of org.springframework.jdbc.core.RowCallbackHandler

    this.passwordEncoder = passwordEncoder;
  }

  public void secureDatabase() {
      getJdbcTemplate().query("select username, password from users",
                               new RowCallbackHandler(){
        @Override
        public void processRow(ResultSet rs) throws SQLException {
          String username = rs.getString(1);
          String password = rs.getString(2);
          UserDetails user =
View Full Code Here

Examples of org.springframework.jdbc.core.RowCallbackHandler

   * only the ordering of these first three columns.
   */
  public void loadBeanDefinitions(String sql) {
    Assert.notNull(this.jdbcTemplate, "Not fully configured - specify DataSource or JdbcTemplate");
    final Properties props = new Properties();
    this.jdbcTemplate.query(sql, new RowCallbackHandler() {
      public void processRow(ResultSet rs) throws SQLException {
        String beanName = rs.getString(1);
        String property = rs.getString(2);
        String value = rs.getString(3);
        // Make a properties entry by combining bean name and property.
View Full Code Here

Examples of org.springframework.jdbc.core.RowCallbackHandler

    NamedParameterJdbcTemplate jt = new NamedParameterJdbcTemplate(mockDataSource);
    Map params = new HashMap();
    params.put("id", new SqlParameterValue(Types.DECIMAL, new Integer(1)));
    params.put("country", "UK");
    final List customers = new LinkedList();
    jt.query(SELECT_NAMED_PARAMETERS, params, new RowCallbackHandler() {
      public void processRow(ResultSet rs) throws SQLException {
        Customer cust = new Customer();
        cust.setId(rs.getInt(COLUMN_NAMES[0]));
        cust.setForename(rs.getString(COLUMN_NAMES[1]));
        customers.add(cust);
View Full Code Here

Examples of org.springframework.jdbc.core.RowCallbackHandler

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

   * @see org.apache.ctakes.ytex.libsvm.LibSVMUtil#loadClassLabels(java.lang.String, java.util.Set)
   */
  public SortedMap<Integer, Map<String, Integer>> loadClassLabels(
      String strQuery, final Set<String> labels) {
    final SortedMap<Integer, Map<String, Integer>> instanceLabelsMap = new TreeMap<Integer, Map<String, Integer>>();
    jdbcTemplate.query(strQuery, new RowCallbackHandler() {

      @Override
      public void processRow(ResultSet rs) throws SQLException {
        int instanceId = rs.getInt(1);
        String label = rs.getString(2);
View Full Code Here

Examples of org.springframework.jdbc.core.RowCallbackHandler

  private void loadDocumentIds(final List<Long> documentIds,
      final List<Long> testDocumentIds, final String instanceIDQuery) {
    txTemplate.execute(new TransactionCallback<Object>() {
      @Override
      public List<Integer> doInTransaction(TransactionStatus arg0) {
        jdbcTemplate.query(instanceIDQuery, new RowCallbackHandler() {
          Boolean trainFlag = null;

          /**
           * <ul>
           * <li>1st column - document id
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.