Example usage for org.springframework.jdbc.datasource DriverManagerDataSource setPassword

List of usage examples for org.springframework.jdbc.datasource DriverManagerDataSource setPassword

Introduction

In this page you can find the example usage for org.springframework.jdbc.datasource DriverManagerDataSource setPassword.

Prototype

public void setPassword(@Nullable String password) 

Source Link

Document

Set the JDBC password to use for connecting through the Driver.

Usage

From source file:cz.swi2.mendeluis.dataaccesslayer.core.DatabaseConfig.java

@Bean
public DataSource db() {
    DriverManagerDataSource builder = new DriverManagerDataSource();
    builder.setDriverClassName("com.mysql.jdbc.Driver");
    builder.setUrl("jdbc:mysql://127.0.0.1:3306/mendeluis?zeroDateTimeBehavior=convertToNull");
    builder.setUsername("mendeluis");
    builder.setPassword("mendeluis");

    return builder;

}

From source file:com.project.framework.configuration.DBConfig.java

@Bean
public DataSource getDataSource() {
    DriverManagerDataSource dataSource = new DriverManagerDataSource();
    dataSource.setDriverClassName(env.getProperty("postgresql.driver"));
    dataSource.setUrl(env.getProperty("postgresql.url"));
    dataSource.setUsername(env.getProperty("postgresql.username"));
    dataSource.setPassword(env.getProperty("postgresql.password"));
    return dataSource;
}

From source file:com.app.config.App2Config.java

/**
 * Primary because if we have activated embedded databases, we do not want
 * the application to connect to an external database.
 *
 * @return//w  ww  .j a  v a2s .  c  o m
 */
@Bean(name = "appDataSource")
public DataSource dataSource() {
    DriverManagerDataSource dataSource = new DriverManagerDataSource();

    dataSource.setDriverClassName("com.mysql.jdbc.Driver");
    dataSource.setUrl("jdbc:mysql://localhost/iivos_ap");
    dataSource.setUsername("root");
    dataSource.setPassword("");

    return dataSource;
}

From source file:net.sourceforge.subsonic.dao.HsqlDaoHelper.java

private DataSource createDataSource() {
    File subsonicHome = SettingsService.getSubsonicHome();
    DriverManagerDataSource ds = new DriverManagerDataSource();
    ds.setDriverClassName("org.hsqldb.jdbcDriver");
    ds.setUrl("jdbc:hsqldb:file:" + subsonicHome.getPath() + "/db/subsonic");
    ds.setUsername("sa");
    ds.setPassword("");

    return ds;/*  w  w  w  .  ja v a  2s  .  c  o m*/
}

From source file:runtheshow.frontend.config.AppConfiguration.java

@Bean
public DriverManagerDataSource dataSource() {
    DriverManagerDataSource driverManagerDataSource = new DriverManagerDataSource();
    driverManagerDataSource.setDriverClassName("com.mysql.jdbc.Driver");
    driverManagerDataSource.setUrl("jdbc:mysql://localhost:3306/runtheshow");
    driverManagerDataSource.setUsername("root");
    driverManagerDataSource.setPassword("Run$The$Show");
    return driverManagerDataSource;
}

From source file:com.example.spring.boot.config.DatabaseConfig.java

/**
 * DataSource definition for database connection. Settings are read from the
 * application.properties file (using the env object).
 *///w  w  w. ja v a2s  .co  m
@Bean
public DataSource dataSource() {
    DriverManagerDataSource dataSource = new DriverManagerDataSource();
    dataSource.setDriverClassName(env.getProperty("db.driver"));
    dataSource.setUrl(env.getProperty("db.url"));
    dataSource.setUsername(env.getProperty("db.username"));
    dataSource.setPassword(env.getProperty("db.password"));
    return dataSource;
}

From source file:com.github.fedorchuck.webstore.config.DataConfig.java

@Bean
public DataSource dataSource() {
    DriverManagerDataSource dataSource = new DriverManagerDataSource();
    dataSource.setDriverClassName(driverClassName);
    dataSource.setUrl(url);/*from   w  w w . j a v  a  2 s .c om*/
    dataSource.setUsername(username);
    dataSource.setPassword(password);

    return dataSource;
}

From source file:com.pojur.config.JPAConfig.java

@Bean
public DataSource dataSource() {
    DriverManagerDataSource dataSource = new DriverManagerDataSource();
    dataSource.setDriverClassName(environment.getProperty("jdbc.driverClassName"));
    dataSource.setUrl(environment.getProperty("jdbc.url"));
    dataSource.setUsername(environment.getProperty("jdbc.username"));
    dataSource.setPassword(environment.getProperty("jdbc.password"));
    //        dataSource.setDriverClassName("com.mysql.jdbc.Driver");
    //        dataSource.setUrl("jdbc:mysql://localhost:3306/spring2explore");
    //        dataSource.setUsername("root");
    //        dataSource.setPassword("pwdroot");
    return dataSource;
}

From source file:com.pavikumbhar.javaheart.springconfiguration.DataSourceConfig.java

@Bean
@Profile("dev")/*from   w ww.  jav  a  2  s . co m*/
public DataSource dataSourceDev() {
    DriverManagerDataSource dataSource = new DriverManagerDataSource();
    dataSource.setDriverClassName(environment.getRequiredProperty("database.driverClass"));
    dataSource.setUrl(environment.getRequiredProperty("database.url"));
    dataSource.setUsername(environment.getRequiredProperty("database.username"));
    dataSource.setPassword(environment.getRequiredProperty("database.password"));
    return dataSource;
}

From source file:com.springmvc.videoteca.spring.config.SpringDBConfig.java

@Bean
public DataSource dataSource() {
    DriverManagerDataSource dataSource = new DriverManagerDataSource();
    dataSource.setDriverClassName(environment.getRequiredProperty("jdbc.driverClassName"));
    dataSource.setUrl(environment.getRequiredProperty("jdbc.url"));
    dataSource.setUsername(environment.getRequiredProperty("jdbc.username"));
    dataSource.setPassword(environment.getRequiredProperty("jdbc.password"));
    return dataSource;
}