Package org.springframework.jdbc.datasource

Examples of org.springframework.jdbc.datasource.SingleConnectionDataSource


        };
    }

    @Before
    public void setUp() throws Exception {
        DriverManagerDataSource dataSource = new SingleConnectionDataSource(url, user, password, true);
        dataSource.setDriverClassName(driverClass);
        ds = dataSource;

        JdbcTemplate jdbc = new JdbcTemplate(ds);
        jdbc.execute("create table customer (id varchar(15) PRIMARY KEY, name varchar(10))");
        jdbc.execute("insert into customer values('cust1','jstrachan')");
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

    rs.close();
    rsControl.setVoidCallable(1);
    rsControl.replay();

    jdbcTemplate = new JdbcTemplate();
    jdbcTemplate.setDataSource(new SingleConnectionDataSource(con, false));
    jdbcTemplate.setExceptionTranslator(new SQLStateSQLExceptionTranslator());
    jdbcTemplate.afterPropertiesSet();
  }
View Full Code Here

    conControl.replay();
    stmtControl.replay();

    jdbcTemplate = new JdbcTemplate();
    jdbcTemplate.setDataSource(new SingleConnectionDataSource(con, false));
    jdbcTemplate.setExceptionTranslator(new SQLStateSQLExceptionTranslator());
    jdbcTemplate.afterPropertiesSet();
  }
View Full Code Here

    ctrlResultSet.replay();
    ctrlStatement.replay();
    replay();

    SingleConnectionDataSource scf = new SingleConnectionDataSource(mockDataSource.getConnection(), false);
    JdbcTemplate template2 = new JdbcTemplate(scf, false);
    RowCountCallbackHandler rcch = new RowCountCallbackHandler();
    template2.query(sql, rcch);

    ctrlResultSet.verify();
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

    @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() throws Exception {
                ds = new SingleConnectionDataSource(url, user, password, true);

                SqlEndpoint sql = new SqlEndpoint();
                sql.setJdbcTemplate(new JdbcTemplate(ds));
                sql.setQuery("select * from projects");

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 id = # order by id").to("mock:result");
            }
        };
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.