Package org.springframework.jdbc.datasource

Examples of org.springframework.jdbc.datasource.DriverManagerDataSource


    Connection conn;
    JDBCPhotoSpotRepository repo = new JDBCPhotoSpotRepository();

    @Before
    public void initMockDB() throws Exception {
        repo.dataSource = new DriverManagerDataSource("jdbc:h2:mem:test", "sa", "sa");
        conn = repo.dataSource.getConnection();

        conn.createStatement().execute("create table PhotoSpot (id int auto_increment primary key, name varchar, description varchar, latitude float, longitude float)");
    }
View Full Code Here


    DataSource dataSource;
    HibernatePhotoSpotRepository repo = new HibernatePhotoSpotRepository();

    @Before
    public void setUp() throws Exception {
        dataSource = new DriverManagerDataSource("jdbc:h2:mem:hibernate;DB_CLOSE_DELAY=-1", "sa", "sa");

        System.setProperty("hibernate.dialect", H2Dialect.class.getName());
        System.setProperty("hibernate.hbm2ddl.auto", "create-drop");
        AnnotationSessionFactoryBean sessionFactory = new AnnotationSessionFactoryBean();
        sessionFactory.setDataSource(dataSource);
View Full Code Here

    String nativeUrl = url;
    if( url.startsWith("jdbc:p6spy:") ) {
      nativeUrl = url.replace("jdbc:p6spy:", "jdbc:");
    }

    setupTestData(new DriverManagerDataSource(nativeUrl, username, password));
  }
View Full Code Here

  /**
   * @see junit.framework.TestCase#setUp()
   */
  protected void setUp() throws Exception {
    //Initialization of the datasource
    this.dataSource = new DriverManagerDataSource();
    this.dataSource.setDriverClassName("org.hsqldb.jdbcDriver");
    this.dataSource.setUrl("jdbc:hsqldb:test");
    this.dataSource.setUsername("sa");
    this.dataSource.setPassword("");
    this.template = new JdbcTemplate(this.dataSource);
View Full Code Here

    }
 
    @Bean
    public DataSource dataSource(){
       
        DriverManagerDataSource ds = new DriverManagerDataSource();
   
        ds.setDriverClassName("org.hsqldb.jdbcDriver");
        ds.setUrl("jdbc:hsqldb:mem:testdb");
        ds.setUsername("sa");
        ds.setPassword("");
   
        return ds;
   
    }
View Full Code Here

    }
 
    @Bean
    public DataSource dataSource(){
       
        DriverManagerDataSource ds = new DriverManagerDataSource();
   
        ds.setDriverClassName("org.hsqldb.jdbcDriver");
        ds.setUrl("jdbc:hsqldb:mem:testdb");
        ds.setUsername("sa");
        ds.setPassword("");
   
        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

            }
        };
    }

    protected 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

            }
        };
    }

    protected 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

        };
    }

    @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

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.