Package org.springframework.jdbc.datasource

Examples of org.springframework.jdbc.datasource.DriverManagerDataSource


    @Before
    public void onSetUp() throws Exception
    {
        for (String dataSourceName : dataSourceNames)
        {
            DriverManagerDataSource dataSource = new DriverManagerDataSource();
            dataSource.setDriverClassName(properties.getProperty("jdbc.driver"));
            dataSource.setUrl(properties.getProperty("jdbc.url") + dataSourceName + ";DB_CLOSE_DELAY=-1");
            dataSource.setUsername(properties.getProperty("jdbc.username"));
            dataSource.setPassword(properties.getProperty("jdbc.password"));
            JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
            jdbcTemplate.execute("create table db_name (name varchar(128))");
            jdbcTemplate.update("insert into db_name values ('" + dataSourceName + "')");
        }
    }
View Full Code Here


        };
    }

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

        JdbcTemplate jdbc = new JdbcTemplate(ds);
        jdbc.execute("create table customer (id varchar(15), name varchar(10))");
        jdbc.execute("insert into customer values('0','jstrachan')");
View Full Code Here

        };
    }

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

        JdbcTemplate jdbc = new JdbcTemplate(ds);
        jdbc.execute("create table customer (id varchar(15), name varchar(10))");
        jdbc.execute("insert into customer values('cust1','jstrachan')");
View Full Code Here

    /**
     * Creates a <code>DataSource</code> using hsqldb in memory-only mode
     * @return the <code>DataSource</code>
     */
    private static DataSource createDataSource() {
        DriverManagerDataSource ds = new DriverManagerDataSource();
        ds.setDriverClassName("org.hsqldb.jdbcDriver");
        ds.setUrl("jdbc:hsqldb:mem:test-database");
        ds.setUsername("sa");

        return ds;
    }
View Full Code Here

            // END SNIPPET: route
        };
    }

    protected void setUp() throws Exception {
        DriverManagerDataSource dataSource = new DriverManagerDataSource(url, user, password);
        dataSource.setDriverClassName(driverClass);
        ds = dataSource;

        JdbcTemplate jdbc = new JdbcTemplate(ds);
        // START SNIPPET: setup
        jdbc.execute("create table customer (id varchar(15), name varchar(10))");
View Full Code Here

    context.setEventId("notmanaged");
    flowExecution.resume(context);
  }

  private DataSource getDataSource() {
    DriverManagerDataSource dataSource = new DriverManagerDataSource();
    dataSource.setDriverClassName("org.hsqldb.jdbcDriver");
    dataSource.setUrl("jdbc:hsqldb:mem:jpa");
    dataSource.setUsername("sa");
    dataSource.setPassword("");
    return dataSource;
  }
View Full Code Here

    context.setEventId("notmanaged");
    flowExecution.resume(context);
  }

  private DataSource getDataSource() {
    DriverManagerDataSource dataSource = new DriverManagerDataSource();
    dataSource.setDriverClassName("org.hsqldb.jdbcDriver");
    dataSource.setUrl("jdbc:hsqldb:mem:jpa");
    dataSource.setUsername("sa");
    dataSource.setPassword("");
    return dataSource;
  }
View Full Code Here

    jpaListener.exceptionThrown(context, new FlowExecutionException("foo", "bar", "test"));
    assertSessionNotBound();
  }

  private DataSource getDataSource() {
    DriverManagerDataSource dataSource = new DriverManagerDataSource();
    dataSource.setDriverClassName("org.hsqldb.jdbcDriver");
    dataSource.setUrl("jdbc:hsqldb:mem:jpa");
    dataSource.setUsername("sa");
    dataSource.setPassword("");
    return dataSource;
  }
View Full Code Here

    Hibernate.initialize(bean.getAddresses());
    assertTrue("addresses should be initialized", Hibernate.isInitialized(bean.getAddresses()));
  }

  private DataSource getDataSource() {
    DriverManagerDataSource dataSource = new DriverManagerDataSource();
    dataSource.setDriverClassName("org.hsqldb.jdbcDriver");
    dataSource.setUrl("jdbc:hsqldb:mem:hspcl");
    dataSource.setUsername("sa");
    dataSource.setPassword("");
    return dataSource;
  }
View Full Code Here

      TransactionSynchronizationManager.clearSynchronization();
    }
  }

  public void testClobStringTypeWithSynchronizedConnection() throws Exception {
    DataSource dsTarget = new DriverManagerDataSource();
    DataSource ds = new LazyConnectionDataSourceProxy(dsTarget);

    lobHandler.getClobAsString(rs, 1);
    lobHandlerControl.setReturnValue("content", 2);
    lobCreator.setClobAsString(ps, 1, "content");
View Full Code Here

TOP

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

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.