Package org.springframework.jdbc.datasource

Examples of org.springframework.jdbc.datasource.SingleConnectionDataSource


    @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.setCamelContext(context);
                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

     * @param dataSourceName
     * @param properties
     * @return
     */
    public static DBConnectionManager createInstance(String dataSourceName, ConnectionProperties properties) {
      DataSource ds = new SingleConnectionDataSource(
          properties.getDriverClassName(),
          properties.getUrl(),
          properties.getUsername(),
          properties.getPassword(),
          true);
View Full Code Here

     * Destroy the connection, closeing the underlying data source. This method only has effect on connections
     * created using {@link #createInstance(String, ConnectionProperties)}
     */
    public void destroy() {
      if (this.ds instanceof SingleConnectionDataSource) {
        SingleConnectionDataSource scds = (SingleConnectionDataSource)this.ds;
        scds.destroy();
      }
    }
View Full Code Here

     * @param dataSourceName
     * @param properties
     * @return
     */
    public static DBConnectionManager createInstance(String dataSourceName, ConnectionProperties properties) {
      DataSource ds = new SingleConnectionDataSource(
          properties.getDriverClassName(),
          properties.getUrl(),
          properties.getUsername(),
          properties.getPassword(),
          true);
View Full Code Here

     * Destroy the connection, closeing the underlying data source. This method only has effect on connections
     * created using {@link #createInstance(String, ConnectionProperties)}
     */
    public void destroy() {
      if (this.ds instanceof SingleConnectionDataSource) {
        SingleConnectionDataSource scds = (SingleConnectionDataSource)this.ds;
        scds.destroy();
      }
    }
View Full Code Here

     * @param dataSourceName
     * @param properties
     * @return
     */
    public static DBConnectionManager createInstance(String dataSourceName, ConnectionProperties properties) {
      DataSource ds = new SingleConnectionDataSource(
          properties.getDriverClassName(),
          properties.getUrl(),
          properties.getUsername(),
          properties.getPassword(),
          true);
View Full Code Here

     * Destroy the connection, closeing the underlying data source. This method only has effect on connections
     * created using {@link #createInstance(String, ConnectionProperties)}
     */
    public void destroy() {
      if (this.ds instanceof SingleConnectionDataSource) {
        SingleConnectionDataSource scds = (SingleConnectionDataSource)this.ds;
        scds.destroy();
      }
    }
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

    }
   
    @Before
    public void setUp() throws Exception {
        Class.forName(driverClass);
        ds = new SingleConnectionDataSource(url, user, password, true);
       
        jdbcTemplate = new JdbcTemplate(ds);
        jdbcTemplate.execute("create table projects (id integer primary key, project varchar(10), license varchar(5))");
        jdbcTemplate.execute("insert into projects values (1, 'Camel', 'ASF')");
        jdbcTemplate.execute("insert into projects values (2, 'AMQ', 'ASF')");
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.