Package org.springframework.jdbc.core

Examples of org.springframework.jdbc.core.RowCallbackHandler


        restrictionsTypes = new int[1];
      }
      restrictionsValues[0] = storePath;
      restrictionsTypes[0] = Types.VARCHAR;
      jdbcTemplate.query(sql.toString(), restrictionsValues, restrictionsTypes,
          new RowCallbackHandler() {

            @Override
            public void processRow(ResultSet rs) throws SQLException {
              preferences.put(rs.getString(1), rs.getString(2));
            }
View Full Code Here


    String sql = "select d.path, f.filename, f.modified, f.size from library.file f"
        + " inner join library.directory d on f.directory_id = d.id"
        + " where d.path = ?";
   
    final Set<File> files = new HashSet<>();
    jdbcTemplate.query(sql, new Object[]{directory}, new RowCallbackHandler() {
      @Override
      public void processRow(ResultSet rs) throws SQLException {
        String directory = rs.getString(1);
        String filename = rs.getString(2);
        DateTime modified = new DateTime(rs.getTimestamp(3).getTime());
View Full Code Here

        + " where lt.id in (" + PostgreSQLUtil.getIdParameters(trackIds) + ")";

    final Map<Integer, String> map = new HashMap<>();

    if (!trackIds.isEmpty()) {
      jdbcTemplate.query(sql, new RowCallbackHandler() {
        @Override
        public void processRow(ResultSet rs) throws SQLException {
          String coverArtFile = getFileName(rs.getString(2), rs.getString(3));
          if (coverArtFile == null) {
            coverArtFile = getFileName(rs.getString(4), rs.getString(5));
View Full Code Here

  public Map<String, String> getCorrectedTags() {
    String sql = "select t.tag_name, tc.tag_name from music.tag t"
        + " inner join music.tag tc on t.corrected_id = tc.id";

    final Map<String, String> correctedTags = new HashMap<>();
    jdbcTemplate.query(sql, new RowCallbackHandler() {
      @Override
      public void processRow(ResultSet rs) throws SQLException {
        correctedTags.put(rs.getString(1), rs.getString(2));
      }
    });
View Full Code Here

        + " inner join music.album alb on ai.album_id = alb.id"
        + " where alb.id in (" + getParameters(paths.size()) + ")";

    final Map<Integer, AlbumInfo> albumInfos = new HashMap<>();
    try {
      jdbcTemplate.query(sql, paths.toArray(), new RowCallbackHandler() {
        @Override
        public void processRow(ResultSet rs) throws SQLException {
          AlbumInfo ai = new AlbumInfo();
          String albumName = rs.getString(1);
          ai.setMediumImageUrl(rs.getString(2));
View Full Code Here

            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

            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

    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

    /* 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

    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

TOP

Related Classes of org.springframework.jdbc.core.RowCallbackHandler

Copyright © 2018 www.massapicom. 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.