@Test void testCreateWithDefaultSettings() throws Exception { TomcatJdbcDataSourceFactory tomcatJdbcDataSourceFactory = new TomcatJdbcDataSourceFactory(); DataSourceInformation dataSourceInformation = new DataSourceInformation( DatabaseType.MYSQL, "localhost", 3306, "test", "user", "password"); DataSource dataSource = tomcatJdbcDataSourceFactory .createDataSource(dataSourceInformation); assertThat(dataSource).isNotNull(); assertThat(dataSource.getDriverClassName()).isEqualTo("com.mysql.jdbc.Driver"); assertThat(dataSource.getUrl()).isEqualTo("jdbc:mysql: assertThat(dataSource.getUsername()).isEqualTo("user"); }
@Override public org.apache.tomcat.jdbc.pool.DataSource createDataSource( DataSourceInformation dataSourceInformation) { PoolConfiguration configurationToUse = new PoolProperties(); BeanUtils.copyProperties(this, configurationToUse); configurationToUse.setDriverClassName(this.databasePlatformSupport .getDriverClassNameForDatabase(dataSourceInformation.getDatabaseType())); configurationToUse.setUrl(this.databasePlatformSupport.getDatabaseUrlForDatabase( dataSourceInformation.getDatabaseType(), dataSourceInformation.getHostName(), dataSourceInformation.getPort(), dataSourceInformation.getDatabaseName())); configurationToUse.setUsername(dataSourceInformation.getUserName()); configurationToUse.setPassword(dataSourceInformation.getPassword()); return new org.apache.tomcat.jdbc.pool.DataSource(configurationToUse); }
TomcatJdbcDataSourceFactory extends PoolProperties implements DataSourceFactory { @Override public org.apache.tomcat.jdbc.pool.DataSource createDataSource( DataSourceInformation dataSourceInformation) { PoolConfiguration configurationToUse = new PoolProperties(); BeanUtils.copyProperties(this, configurationToUse); configurationToUse.setDriverClassName(this.databasePlatformSupport .getDriverClassNameForDatabase(dataSourceInformation.getDatabaseType())); configurationToUse.setUrl(this.databasePlatformSupport.getDatabaseUrlForDatabase( dataSourceInformation.getDatabaseType(), dataSourceInformation.getHostName(), dataSourceInformation.getPort(), dataSourceInformation.getDatabaseName())); configurationToUse.setUsername(dataSourceInformation.getUserName()); configurationToUse.setPassword(dataSourceInformation.getPassword()); return new org.apache.tomcat.jdbc.pool.DataSource(configurationToUse); } }
TomcatJdbcDataSourceFactory extends PoolProperties implements DataSourceFactory { @Override public org.apache.tomcat.jdbc.pool.DataSource createDataSource( DataSourceInformation dataSourceInformation) { PoolConfiguration configurationToUse = new PoolProperties(); BeanUtils.copyProperties(this, configurationToUse); configurationToUse.setDriverClassName(this.databasePlatformSupport .getDriverClassNameForDatabase(dataSourceInformation.getDatabaseType())); configurationToUse.setUrl(this.databasePlatformSupport.getDatabaseUrlForDatabase( dataSourceInformation.getDatabaseType(), dataSourceInformation.getHostName(), dataSourceInformation.getPort(), dataSourceInformation.getDatabaseName())); configurationToUse.setUsername(dataSourceInformation.getUserName()); configurationToUse.setPassword(dataSourceInformation.getPassword()); return new org.apache.tomcat.jdbc.pool.DataSource(configurationToUse); }  }
TomcatJdbcDataSourceFactory extends PoolProperties implements DataSourceFactory { @Override public org.apache.tomcat.jdbc.pool.DataSource createDataSource( DataSourceInformation dataSourceInformation) { PoolConfiguration configurationToUse = new PoolProperties(); BeanUtils.copyProperties(this, configurationToUse); configurationToUse.setDriverClassName(this.databasePlatformSupport .getDriverClassNameForDatabase(dataSourceInformation.getDatabaseType())); configurationToUse.setUrl(this.databasePlatformSupport.getDatabaseUrlForDatabase( dataSourceInformation.getDatabaseType(), dataSourceInformation.getHostName(), dataSourceInformation.getPort(), dataSourceInformation.getDatabaseName())); configurationToUse.setUsername(dataSourceInformation.getUserName()); configurationToUse.setPassword(dataSourceInformation.getPassword()); return new org.apache.tomcat.jdbc.pool.DataSource(configurationToUse); }  @Override void setUsername(String username); @Override void setPassword(String password); @Override void setDriverClassName(String driverClassName); @Override void setUrl(String url); void setDefaultTransactionIsolationName(String constantName); void setDatabasePlatformSupport(
			DatabasePlatformSupport databasePlatformSupport); @Override org.apache.tomcat.jdbc.pool.DataSource createDataSource(
			DataSourceInformation dataSourceInformation); @Override void closeDataSource(DataSource dataSource); }
TomcatJdbcDataSourceFactory extends PoolProperties implements DataSourceFactory { @Override public org.apache.tomcat.jdbc.pool.DataSource createDataSource( DataSourceInformation dataSourceInformation) { PoolConfiguration configurationToUse = new PoolProperties(); BeanUtils.copyProperties(this, configurationToUse); configurationToUse.setDriverClassName(this.databasePlatformSupport .getDriverClassNameForDatabase(dataSourceInformation.getDatabaseType())); configurationToUse.setUrl(this.databasePlatformSupport.getDatabaseUrlForDatabase( dataSourceInformation.getDatabaseType(), dataSourceInformation.getHostName(), dataSourceInformation.getPort(), dataSourceInformation.getDatabaseName())); configurationToUse.setUsername(dataSourceInformation.getUserName()); configurationToUse.setPassword(dataSourceInformation.getPassword()); return new org.apache.tomcat.jdbc.pool.DataSource(configurationToUse); }  @Override void setUsername(String username); @Override void setPassword(String password); @Override void setDriverClassName(String driverClassName); @Override void setUrl(String url); void setDefaultTransactionIsolationName(String constantName); void setDatabasePlatformSupport(
			DatabasePlatformSupport databasePlatformSupport); @Override org.apache.tomcat.jdbc.pool.DataSource createDataSource(
			DataSourceInformation dataSourceInformation); @Override void closeDataSource(DataSource dataSource);  }