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

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

Introduction

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

Prototype

public void setDriverClassName(String driverClassName) 

Source Link

Document

Set the JDBC driver class name.

Usage

From source file:com.rplt.studioMusik.model.DatabaseConnection.java

public static DataSource getmDataSource() {
    DriverManagerDataSource dataSource = new DriverManagerDataSource();
    //        dataSource.setDriverClassName("oracle.jdbc.driver.OracleDriver");  
    //        dataSource.setUrl("jdbc:oracle:thin:@172.23.9.185:1521:orcl");
    //        dataSource.setUsername("mhs125314109");
    //        dataSource.setPassword("mhs125314109");

    dataSource.setDriverClassName("com.mysql.jdbc.Driver");
    dataSource.setUrl("jdbc:mysql://localhost:3306/studiomusik");
    dataSource.setUsername("mhs125314109");
    dataSource.setPassword("mhs125314109");

    return dataSource;
}

From source file:net.firejack.platform.core.utils.db.DBUtils.java

/**
 * @param driverClassName driver classname
 * @param url jdbc url/*from w  w  w. ja  v  a2s . co  m*/
 * @param user db user
 * @param password db user password
 * @return returns populated data-source
 */
public static DataSource populateDataSource(String driverClassName, String url, String user, String password) {
    DriverManagerDataSource dataSource = new DriverManagerDataSource();
    dataSource.setDriverClassName(driverClassName);
    dataSource.setUrl(url);
    dataSource.setUsername(user);
    dataSource.setPassword(password);
    return dataSource;
}

From source file:org.owasp.proxy.Main.java

private static DataSource createDataSource(Configuration config) throws SQLException {
    if (config.jdbcDriver == null)
        return null;
    DriverManagerDataSource dataSource = new DriverManagerDataSource();
    dataSource.setDriverClassName(config.jdbcDriver);
    dataSource.setUrl(config.jdbcUrl);//from  ww w  .  java 2  s  .c o m
    dataSource.setUsername(config.jdbcUser);
    dataSource.setPassword(config.jdbcPassword);
    return dataSource;
}

From source file:com.google.enterprise.connector.sharepoint.TestConfiguration.java

/**
 * gets a sample data source for user data store
 * /*w  w w. j av a  2s . co m*/
 * @return
 */
public static DataSource getUserDataSource() {
    DriverManagerDataSource dataSource = new DriverManagerDataSource();
    dataSource.setDriverClassName(TestConfiguration.driverClass);
    dataSource.setUrl(TestConfiguration.dbUrl);
    dataSource.setUsername(TestConfiguration.dbUsername);
    dataSource.setPassword(TestConfiguration.dbPassword);
    return dataSource;
}

From source file:com.umedia.CloudGate.SampleWebJspApplication.java

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

    return ds;//ww  w . ja  v  a2  s.c  om
}

From source file:com.hackathon.socialstream.config.Application.java

@Bean
public DataSource getDataSource() {
    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:org.spc.ofp.tubs.config.TubsDataSourceConfig.java

@Primary
@Bean(name = { "tubsDataSource" })
public DataSource tubsDataSource() {
    final DriverManagerDataSource dmds = new DriverManagerDataSource();
    dmds.setDriverClassName(JDBC_CLASS_NAME);
    dmds.setUrl(JDBC_URL);/*from   w  w w. j  a  v  a  2s .c  o m*/
    return dmds;
}

From source file:uk.ac.ebi.eva.pipeline.configuration.PostgreDataSourceConfiguration.java

@Bean
@Primary/*w w w .jav  a  2 s  . co  m*/
public DataSource postgreDataSource() {
    DriverManagerDataSource dataSource = new DriverManagerDataSource();
    dataSource.setDriverClassName(env.getProperty("job.repository.driverClassName"));
    dataSource.setUrl(env.getProperty("job.repository.url"));
    dataSource.setUsername(env.getProperty("job.repository.username"));
    dataSource.setPassword(env.getProperty("job.repository.password"));
    return dataSource;
}

From source file:com.examplee.AppConfig.java

@Bean(name = "dataSource")
public DriverManagerDataSource dataSource() {
    DriverManagerDataSource driverManagerDataSource = new DriverManagerDataSource();
    driverManagerDataSource.setDriverClassName("com.mysql.jdbc.Driver");
    driverManagerDataSource.setUrl("jdbc:mysql://localhost:3306/products");
    driverManagerDataSource.setUsername("root");
    driverManagerDataSource.setPassword("Krak1234#");
    return driverManagerDataSource;
}

From source file:com.maxon.tomorrow.app.DatabaseConfig.java

@Bean
public DataSource dataSource() {
    DriverManagerDataSource dataSource = new DriverManagerDataSource();
    dataSource.setDriverClassName(dbDriver);
    dataSource.setUrl(dbFile);/*from  w w w . ja va 2 s  . c  o m*/
    dataSource.setUsername(dbUsername);
    dataSource.setPassword(dbPass);
    return dataSource;
}