Created
July 1, 2014 08:53
-
-
Save masazdream/6a8ea3c790fd89e26257 to your computer and use it in GitHub Desktop.
Doma App Config Data Source
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AppConfig extends DomaAbstractConfig { | |
protected static final LocalTransactionalDataSource dataSource = createDataSource(); | |
protected static final Dialect dialect = new MysqlDialect(); | |
public DataSource getDataSource() { | |
return dataSource; | |
} | |
public Dialect getDialect() { | |
return dialect; | |
} | |
protected static LocalTransactionalDataSource createDataSource() { | |
SimpleDataSource dataSource = new SimpleDataSource(); | |
dataSource.setUrl("jdbc:mysql://localhost:3306/beta_doma_table?useUnicode=true&characterEncoding=utf8"); | |
dataSource.setUser("****"); | |
dataSource.setPassword("****"); | |
return new LocalTransactionalDataSource(dataSource); | |
} | |
public static LocalTransaction getLocalTransaction() { | |
return dataSource.getLocalTransaction(defaultJdbcLogger); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment