Advertisement
Guest User

Untitled

a guest
Feb 16th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. dataSources:
  2. dataSource:
  3. pooled: true
  4. jmxExport: true
  5. driverClassName: org.h2.Driver
  6. username: sa
  7. password:
  8. raw:
  9. dialect: org.hibernate.dialect.Oracle10gDialect
  10. driverClassName: oracle.jdbc.driver.OracleDriver
  11. username: rip
  12. password: password
  13. dbCreate: validate
  14. url: jdbc:oracle:thin:@127.0.0.1:345:coolio
  15.  
  16.  
  17. environments:
  18. development:
  19. dataSources:
  20. dataSource:
  21. dbCreate: create-drop
  22. url: jdbc:h2:mem:devDb;MVCC=TRUE
  23. test:
  24. dataSources:
  25. dataSource:
  26. dbCreate: update
  27. url: jdbc:h2:mem:testDb;MVCC=TRUE
  28. production:
  29. dataSources:
  30. dataSource:
  31. dbCreate: update
  32. url: jdbc:h2:mem:prodDb;MVCC=TRUE
  33.  
  34. class DatabaseService {
  35.  
  36. static datasource = 'raw'
  37. DataSource dataSource
  38.  
  39. public void testMyDb(User user) {
  40. try {
  41. println("we are in here with : " + dataSource.getConnection().getMetaData().getURL())
  42. registerUser(new Sql(dataSource), user)
  43. } catch (SQLException e) {
  44. LOGGER.error("unable to register the user", e)
  45. throw e
  46. }
  47. }
  48.  
  49. public void registerDeveloper(Sql sql, User user) {
  50. sql.call("{call isertUser(?)}", [user.name])
  51. }
  52.  
  53. we are in here with : jdbc:h2:mem:testDb
  54.  
  55. we are in here with : jdbc:oracle:thin:@127.0.0.1:345:coolio
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement