Package org.springframework.jdbc.datasource

Examples of org.springframework.jdbc.datasource.SingleConnectionDataSource


  private final String sql;

  public JdbcSlimRunner(final String driverClassname, final String url, final String username, final String password, final String sql)
          throws ClassNotFoundException {
    Class.forName(driverClassname);
    this.template = new JdbcTemplate(new SingleConnectionDataSource(url, username, password, false));
    this.sql = sql;
  }
View Full Code Here


    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            public void configure() {
                ds = new SingleConnectionDataSource(url, user, password, true);

                getContext().getComponent("sql", SqlComponent.class).setDataSource(ds);

                errorHandler(noErrorHandler());
View Full Code Here

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            public void configure() {
                ds = new SingleConnectionDataSource(url, user, password, true);

                getContext().getComponent("sql", SqlComponent.class).setDataSource(ds);

                errorHandler(noErrorHandler());
               
View Full Code Here

        JdbcTemplate jdbcTemplate = new JdbcTemplate(createDataSource());
        jdbcTemplate.execute("drop table projects");
    }

    private DataSource createDataSource() {
        return new SingleConnectionDataSource(url, user, password, true);
    }
View Full Code Here

        cacheManager.addCache(new Cache("basiclookuptestcache", 500, false, false, 30, 30));
    }

    @BeforeClass
    public static void createDatabase() throws Exception {
        dataSource = new SingleConnectionDataSource("jdbc:hsqldb:mem:lookupstrategytest", "sa", "", true);
        dataSource.setDriverClassName("org.hsqldb.jdbcDriver");
        jdbcTemplate = new JdbcTemplate(dataSource);

        Resource resource = new ClassPathResource("createAclSchema.sql");
        String sql = new String(FileCopyUtils.copyToByteArray(resource.getInputStream()));
View Full Code Here

    private JdbcTokenRepositoryImpl repo;
    private JdbcTemplate template;

    @BeforeClass
    public static void createDataSource() {
        dataSource = new SingleConnectionDataSource("jdbc:hsqldb:mem:tokenrepotest", "sa", "", true);
        dataSource.setDriverClassName("org.hsqldb.jdbc.JDBCDriver");
    }
View Full Code Here

               .forEach(System.out::println);

            System.out.println();
            System.out.println("Fetching data into a lambda expression with Spring JDBC");
            System.out.println("-------------------------------------------------------");
            new JdbcTemplate(new SingleConnectionDataSource(c, true))
                .query(sql,
                    (rs, rowNum) -> new Schema(
                        rs.getString("SCHEMA_NAME"),
                        rs.getBoolean("IS_DEFAULT")
                    ))
View Full Code Here

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            public void configure() {
                ds = new SingleConnectionDataSource(url, user, password, true);

                getContext().getComponent("sql", SqlComponent.class).setDataSource(ds);

                from("direct:simple").to("sql:select * from projects where license = # order by id")
                    .to("mock:result");
View Full Code Here

      throw new DataAccessException("DatabaseMeta problem", e) {
        private static final long serialVersionUID = -3457360074729938909L;
      };
    }
    // create the datasource
    DataSource ds = new SingleConnectionDataSource(dbMeta.getDriverClass(), url, dbMeta.getUsername(), dbMeta
        .getPassword(), false);

    // create the jdbc template
    final JdbcTemplate jt = new JdbcTemplate(ds);
View Full Code Here

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            public void configure() {
                ds = new SingleConnectionDataSource(url, user, password, true);

                getContext().getComponent("sql", SqlComponent.class).setDataSource(ds);

                errorHandler(noErrorHandler());
View Full Code Here

TOP

Related Classes of org.springframework.jdbc.datasource.SingleConnectionDataSource

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.