Advertisement
Guest User

Untitled

a guest
Aug 24th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. import org.springframework.jdbc.core.JdbcTemplate
  2. ...
  3. jdbcTemplate(JdbcTemplate) {
  4. dataSource = ref('dataSource')
  5. ...
  6. }
  7.  
  8. dataSource {
  9. configClass = GrailsAnnotationConfiguration.class
  10. pooled = true
  11. autoreconnect= true
  12. }
  13.  
  14. hibernate {
  15. generate_statistics=true
  16. cache.use_second_level_cache=true
  17. cache.use_query_cache=true
  18. cache.region.factory_class = 'org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory'
  19.  
  20. }
  21.  
  22.  
  23. environments {
  24. development {
  25. dataSource {
  26. driverClassName = "com.mysql.jdbc.Driver"
  27. username = "test"
  28. password = "test"
  29. dbCreate = "update" // one of 'create', 'create-drop','update'
  30. pooled = true
  31. jmxExport = true
  32. url = "jdbc:mysql://host:port/dbName?autoReconnect=true"
  33. }
  34. }
  35.  
  36.  
  37. }
  38.  
  39. def jdbcTemplate
  40.  
  41. def someMethod(){
  42. jdbcTemplate.queryForList(somequery)
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement