Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dataSources:
- dataSource:
- pooled: true
- jmxExport: true
- driverClassName: org.h2.Driver
- username: sa
- password:
- raw:
- dialect: org.hibernate.dialect.Oracle10gDialect
- driverClassName: oracle.jdbc.driver.OracleDriver
- username: rip
- password: password
- dbCreate: validate
- url: jdbc:oracle:thin:@127.0.0.1:345:coolio
- environments:
- development:
- dataSources:
- dataSource:
- dbCreate: create-drop
- url: jdbc:h2:mem:devDb;MVCC=TRUE
- test:
- dataSources:
- dataSource:
- dbCreate: update
- url: jdbc:h2:mem:testDb;MVCC=TRUE
- production:
- dataSources:
- dataSource:
- dbCreate: update
- url: jdbc:h2:mem:prodDb;MVCC=TRUE
- class DatabaseService {
- static datasource = 'raw'
- DataSource dataSource
- public void testMyDb(User user) {
- try {
- println("we are in here with : " + dataSource.getConnection().getMetaData().getURL())
- registerUser(new Sql(dataSource), user)
- } catch (SQLException e) {
- LOGGER.error("unable to register the user", e)
- throw e
- }
- }
- public void registerDeveloper(Sql sql, User user) {
- sql.call("{call isertUser(?)}", [user.name])
- }
- we are in here with : jdbc:h2:mem:testDb
- we are in here with : jdbc:oracle:thin:@127.0.0.1:345:coolio
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement