Package org.springframework.jdbc.core

Examples of org.springframework.jdbc.core.JdbcTemplate$RowCallbackHandlerResultSetExtractor


    }

    protected void createIndexes() {
        LOG.debug("Creating indexes");

        JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);

        for (String idx : indexes.stringPropertyNames()) {
            LOG.debug("Creating index {}", indexes.get(idx).toString());

            try {
                jdbcTemplate.execute(indexes.get(idx).toString());
            } catch (DataAccessException e) {
                LOG.error("Could not create index ", e);
            }
        }
View Full Code Here


    }

    protected void createViews() {
        LOG.debug("Creating views");

        JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);

        for (String idx : views.stringPropertyNames()) {
            LOG.debug("Creating view {}", views.get(idx).toString());

            try {
                jdbcTemplate.execute(views.get(idx).toString().replaceAll("\\n", " "));
            } catch (DataAccessException e) {
                LOG.error("Could not create view ", e);
            }
        }
View Full Code Here

    @Autowired
    private UserRequestDAO userRequestDAO;

    private void upgradeActiviti() {
        JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);

        List<Map<String, Object>> byteArrays =
                jdbcTemplate.queryForList("SELECT ID_, BYTES_ FROM ACT_GE_BYTEARRAY");
        for (Map<String, Object> row : byteArrays) {
            byte[] updated = new String((byte[]) row.get("BYTES_")).replaceAll(
                    "org\\.apache.syncope\\.core\\.workflow\\.activiti\\.",
                    "org.apache.syncope.core.workflow.user.activiti.task.").
                    replaceAll("org\\.apache\\.syncope\\.client\\.to\\.",
                    "org.apache.syncope.common.to").
                    replaceAll("org\\.apache\\.syncope\\.types\\.",
                    "org.apache.syncope.common.types").
                    replaceAll("org/apache/syncope/types/",
                    "org/apache/syncope/common/types/").
                    getBytes();
            jdbcTemplate.update("UPDATE ACT_GE_BYTEARRAY SET BYTES_=? WHERE ID_=?",
                    new Object[] {updated, row.get("ID_")});
        }
    }
View Full Code Here

            }
        }
    }

    private void upgradeReportletConf() {
        JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);

        List<Map<String, Object>> rcInstances =
                jdbcTemplate.queryForList("SELECT id, serializedInstance FROM ReportletConfInstance");
        for (Map<String, Object> row : rcInstances) {
            String updated = ((String) row.get("serializedInstance")).
                    replaceAll("org\\.apache\\.syncope\\.client\\.report\\.",
                    "org.apache.syncope.common.report.");
            jdbcTemplate.update("UPDATE ReportletConfInstance SET serializedInstance=? WHERE id=?",
                    new Object[] {updated, row.get("id")});
        }
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public String getUserPassword(Long userId) {
        JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
        Table table = AnnotationUtils.findAnnotation(User.class, Table.class);
        return jdbcTemplate.queryForObject(
                "select password from " + table.name() + " where id=?", String.class, userId);
    }
View Full Code Here

    private String insertTokenSql = "insert into password_reset_token (username, token, expiration_time) values (?, ?, ?)";
    private String selectTokenSql = "select count(token) from password_reset_token where username=? and token=? and expiration_time > NOW()";

    @Autowired
    public void setDataSource(DataSource dataSource) {
        jdbcTemplate = new JdbcTemplate(dataSource);
    }
View Full Code Here

    private String query = null;

    public DatabaseHealthIndicator(DataSource dataSource) {
        this.dataSource = dataSource;
        this.jdbcTemplate = new JdbcTemplate(dataSource);
    }
View Full Code Here

        ds.setDriverClassName("com.mysql.jdbc.Driver");
        ds.setUrl("jdbc:mysql://localhost:3306/shiro");
        ds.setUsername("root");
        ds.setPassword("");

        return new JdbcTemplate(ds);
    }
View Full Code Here

   
    protected JdbcTemplate jdbcTemplate;
    @Autowired
    private void setDataSource(DataSource ds) {
        jdbcTemplate = new JdbcTemplate(ds);   
    }
View Full Code Here

        ds.setDriverClassName("com.mysql.jdbc.Driver");
        ds.setUrl("jdbc:mysql://localhost:3306/shiro");
        ds.setUsername("root");
        ds.setPassword("");

        return new JdbcTemplate(ds);
    }
View Full Code Here

TOP

Related Classes of org.springframework.jdbc.core.JdbcTemplate$RowCallbackHandlerResultSetExtractor

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.