/** * Create a new DriverManagerDataSource with the given standard Driver parameters. * @param driver the JDBC Driver object * @param url the JDBC URL to use for accessing the DriverManager * @see java.sql.Driver#connect(String, java.util.Properties) */ public SimpleDriverDataSource(Driver driver, String url) { setDriver(driver); setUrl(url); }
/** * Create a new DriverManagerDataSource with the given standard Driver parameters. * @param driver the JDBC Driver object * @param url the JDBC URL to use for accessing the DriverManager * @param conProps the JDBC connection properties * @see java.sql.Driver#connect(String, java.util.Properties) */ public SimpleDriverDataSource(Driver driver, String url, Properties conProps) { setDriver(driver); setUrl(url); setConnectionProperties(conProps); }
/** * Create a new DriverManagerDataSource with the given standard Driver parameters. * @param driver the JDBC Driver object * @param url the JDBC URL to use for accessing the DriverManager * @param username the JDBC username to use for accessing the DriverManager * @param password the JDBC password to use for accessing the DriverManager * @see java.sql.Driver#connect(String, java.util.Properties) */ public SimpleDriverDataSource(Driver driver, String url, String username, String password) { setDriver(driver); setUrl(url); setUsername(username); setPassword(password); }
@Bean public DataSource dataSource(){ SimpleDriverDataSource dataSource = new SimpleDriverDataSource(); dataSource.setDriver(new Driver()); dataSource.setUrl("jdbc:h2:mem:test;MODE=mysql;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE"); dataSource.setUsername("sa"); dataSource.setPassword(""); return dataSource; }
/** * Create a new DriverManagerDataSource with the given standard Driver parameters. * @param driver the JDBC Driver object * @param url the JDBC URL to use for accessing the DriverManager * @see java.sql.Driver#connect(String, java.util.Properties) */ public SimpleDriverDataSource(Driver driver, String url) { setDriver(driver); setUrl(url); }
/** * Create a new DriverManagerDataSource with the given standard Driver parameters. * @param driver the JDBC Driver object * @param url the JDBC URL to use for accessing the DriverManager * @see java.sql.Driver#connect(String, java.util.Properties) */ public SimpleDriverDataSource(Driver driver, String url) { setDriver(driver); setUrl(url); }
/** * Create a new DriverManagerDataSource with the given standard Driver parameters. * @param driver the JDBC Driver object * @param url the JDBC URL to use for accessing the DriverManager * @param conProps the JDBC connection properties * @see java.sql.Driver#connect(String, java.util.Properties) */ public SimpleDriverDataSource(Driver driver, String url, Properties conProps) { setDriver(driver); setUrl(url); setConnectionProperties(conProps); }
/** * Create a new DriverManagerDataSource with the given standard Driver parameters. * @param driver the JDBC Driver object * @param url the JDBC URL to use for accessing the DriverManager * @param conProps JDBC connection properties * @see java.sql.Driver#connect(String, java.util.Properties) */ public SimpleDriverDataSource(Driver driver, String url, Properties conProps) { setDriver(driver); setUrl(url); setConnectionProperties(conProps); }
/** * Create a new DriverManagerDataSource with the given standard Driver parameters. * @param driver the JDBC Driver object * @param url the JDBC URL to use for accessing the DriverManager * @param username the JDBC username to use for accessing the DriverManager * @param password the JDBC password to use for accessing the DriverManager * @see java.sql.Driver#connect(String, java.util.Properties) */ public SimpleDriverDataSource(Driver driver, String url, String username, String password) { setDriver(driver); setUrl(url); setUsername(username); setPassword(password); }
/** * Create a new DriverManagerDataSource with the given standard Driver parameters. * @param driver the JDBC Driver object * @param url the JDBC URL to use for accessing the DriverManager * @param username the JDBC username to use for accessing the DriverManager * @param password the JDBC password to use for accessing the DriverManager * @see java.sql.Driver#connect(String, java.util.Properties) */ public SimpleDriverDataSource(Driver driver, String url, String username, String password) { setDriver(driver); setUrl(url); setUsername(username); setPassword(password); }
@Bean(name="dataSourceRedshift") public DataSource dataSourceRedshift() throws SQLException, JSchException { SimpleDriverDataSource dataSource = new SimpleDriverDataSource(); dataSource.setDriver(new com.amazon.redshift.jdbc41.Driver()); dataSource.setUrl("jdbc:postgresql://" + redshiftHost + ":" + redshiftPort + "/" + redshiftDatabase); dataSource.setUsername(redshiftUser); dataSource.setPassword(redshiftPass); DefaultSessionFactory defaultSessionFactory = new DefaultSessionFactory(); TunneledDataSourceWrapper tunneledDataSource = new TunneledDataSourceWrapper( new TunnelConnectionManager( defaultSessionFactory, redshiftTunnel ), dataSource ); return tunneledDataSource; }