Package org.springframework.jdbc.datasource

Examples of org.springframework.jdbc.datasource.SimpleDriverDataSource


    @Before
    public void setup() throws Exception
    {
        new CreateDatabase(URL, USERNAME, PASSWORD).execute();

        DataSource dataSource = new SimpleDriverDataSource(new Driver(), URL, USERNAME, PASSWORD);
        migrationManager = new DataSourceMigrationManager(dataSource);
        migrationManager.setMigrationResolver(new ResourceMigrationResolver("classpath:/test_migrations/mysql_50/"));

        jdbcTemplate = new SimpleJdbcTemplate(dataSource);
    }
View Full Code Here


    /**
     * @throws  Exception on test setup.
     */
    public void setUp() throws Exception {
        super.setUp();
        this.testDataSource = new SimpleDriverDataSource(
                new org.hsqldb.jdbcDriver(),
                "jdbc:hsqldb:mem:locktest",
                "sa",
                "");
        final JdbcTemplate tmpl = new JdbcTemplate(this.testDataSource);
View Full Code Here

        if (dbDriver == null || dbDriver.length() == 0) {
          dbDriver = ApplicationContextHolder.getYtexProperties()
              .getProperty("db.driver");
        }
        dataSource = new SimpleDriverDataSource((Driver) Class.forName(
            dbDriver).newInstance(), dbURL);
        txTemplate = new TransactionTemplate(
            new DataSourceTransactionManager(dataSource));
      } catch (InstantiationException e) {
        throw new ResourceInitializationException(e);
View Full Code Here

    private static final String PASSWORD = "";

    @Before
    public void setup() throws Exception
    {
        DataSource dataSource = new SimpleDriverDataSource(new jdbcDriver(), URL, USERNAME, PASSWORD);
        migrationManager = new DataSourceMigrationManager(dataSource);
        migrationManager.setMigrationResolver(new ResourceMigrationResolver("classpath:/test_migrations/hsql/"));

        jdbcTemplate = new SimpleJdbcTemplate(dataSource);
    }
View Full Code Here

    @Before
    public void setup() throws Exception
    {
        new CreateDatabase(URL, USERNAME, PASSWORD).execute();

        DataSource dataSource = new SimpleDriverDataSource(new Driver(), URL, USERNAME, PASSWORD);
        migrationManager = new DataSourceMigrationManager(dataSource);
        migrationManager.setMigrationResolver(new ResourceMigrationResolver("classpath:/test_migrations/sqlserver_2000/"));

        jdbcTemplate = new SimpleJdbcTemplate(dataSource);
    }
View Full Code Here

    @Before
    public void setup() throws Exception
    {
        new CreateDatabase(URL, USERNAME, PASSWORD).execute();

        DataSource dataSource = new SimpleDriverDataSource(new Driver(), URL, USERNAME, PASSWORD);
        migrationManager = new DataSourceMigrationManager(dataSource);
        migrationManager.setMigrationResolver(new ResourceMigrationResolver("classpath:/test_migrations/postgresql_8/"));

        jdbcTemplate = new SimpleJdbcTemplate(dataSource);
    }
View Full Code Here

    private static final String PASSWORD = "";

    @Before
    public void setup() throws Exception
    {
        DataSource dataSource = new SimpleDriverDataSource(new Driver(), URL, USERNAME, PASSWORD);
        migrationManager = new DataSourceMigrationManager(dataSource);
        migrationManager.setMigrationResolver(new ResourceMigrationResolver("classpath:/test_migrations/h2/"));

        jdbcTemplate = new SimpleJdbcTemplate(dataSource);
    }
View Full Code Here

    long start = System.currentTimeMillis();
    logger.info("MySQL:");
    createService(VCAP_MYSQL_SERVICE, "mysql", "5.1");
    int tunnelPort = LOCAL_PORT;
    createTunnelServer(VCAP_MYSQL_SERVICE, tunnelPort);
    ds = new SimpleDriverDataSource();
    String url = "jdbc:mysql://"+ LOCAL_HOST + ":" + tunnelPort + "/" + svc_dbname + "?rewriteBatchedStatements=true";
    ((SimpleDriverDataSource)ds).setDriverClass(com.mysql.jdbc.Driver.class);
    ((SimpleDriverDataSource)ds).setUrl(url);
    ((SimpleDriverDataSource)ds).setUsername(svc_username);
    ((SimpleDriverDataSource)ds).setPassword(svc_passwd);
View Full Code Here

    long start = System.currentTimeMillis();
    logger.info("PostgreSQL:");
    createService(VCAP_POSTGRES_SERVICE, "postgresql", "9.0");
    int tunnelPort = LOCAL_PORT + 1;
    createTunnelServer(VCAP_POSTGRES_SERVICE, tunnelPort);
    ds = new SimpleDriverDataSource();
    String url = "jdbc:postgresql://"+ LOCAL_HOST + ":" + tunnelPort + "/" + svc_dbname;
    ((SimpleDriverDataSource)ds).setDriverClass(org.postgresql.Driver.class);
    ((SimpleDriverDataSource)ds).setUrl(url);
    ((SimpleDriverDataSource)ds).setUsername(svc_username);
    ((SimpleDriverDataSource)ds).setPassword(svc_passwd);
View Full Code Here

    @Value("${cb.hbm2ddl.strategy:update}")
    private String hbm2ddlStrategy;

    @Bean
    public DataSource dataSource() {
        SimpleDriverDataSource dataSource = new SimpleDriverDataSource();
        dataSource.setDriverClass(Driver.class);
        dataSource.setUrl(String.format("jdbc:postgresql://%s:%s/%s", dbHost, dbPort, dbName));
        dataSource.setUsername(dbUser);
        dataSource.setPassword(dbPassword);
        return dataSource;
    }
View Full Code Here

TOP

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

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.