Package com.nurkiewicz.jdbcrepository.mysql

Source Code of com.nurkiewicz.jdbcrepository.mysql.JdbcRepositoryTestMysqlConfig

package com.nurkiewicz.jdbcrepository.mysql;

import com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource;
import com.nurkiewicz.jdbcrepository.JdbcRepositoryTestConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import javax.sql.DataSource;

@EnableTransactionManagement
@Configuration
public class JdbcRepositoryTestMysqlConfig extends JdbcRepositoryTestConfig {

  public static final int MYSQL_PORT = 3306;

  @Bean
  @Override
  public DataSource dataSource() {
    MysqlConnectionPoolDataSource ds = new MysqlConnectionPoolDataSource();
    ds.setUser("root");
    ds.setPassword(System.getProperty("mysql.password", ""));
    ds.setDatabaseName("spring_data_jdbc_repository_test");
    return ds;
  }

}
TOP

Related Classes of com.nurkiewicz.jdbcrepository.mysql.JdbcRepositoryTestMysqlConfig

TOP
Copyright © 2018 www.massapi.com. 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.