I hereby claim:
- I am lubarinobr on github.
- I am lubarino (https://keybase.io/lubarino) on keybase.
- I have a public key ASBRT8ph2VoWvdFfbrCp9ZqCgC_ddKFgnXbyyF7PlHEedAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
public class Factory { | |
public getBean(Class theInterface) { | |
try { | |
Class clazz = Class.forName(theInterface.getName+"Impl"); | |
return clazz.newInstance(); | |
} catch (ReflectiveOperationException e) { | |
return null; | |
} | |
} | |
} |
package br.com.lubarino.profiles.conexao; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.context.annotation.Profile; | |
@Configuration | |
@Profile("qa") | |
public class BaseConfiguration { |
spring.profiles.active=qa,stg |
spring.profiles.active=qa |
database.url: mysql-instance1-teste.rds.amazonaws.com | |
database.username: usuarioAmazon | |
database.password: senhaAmazon |
package br.com.lubarino.profiles.conexao; | |
import org.springframework.beans.factory.annotation.Value; | |
import java.sql.Connection; | |
import java.sql.DriverManager; | |
import java.sql.SQLException; | |
public class JDBCConnection { |
database: | |
url: localhost | |
username: root | |
password: algumasenha |
database.url=localhost | |
database.username=root | |
database.password=algumasenha |
public Connection connect() throws ClassNotFoundException, SQLException { | |
Class.forName("com.mysql.jdbc.Driver"); | |
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/test","username", "password"); | |
return connection; | |
} |