Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. CREATE TABLE `ggloor`.`teams` (
  2. `idteam` INT NOT NULL AUTO_INCREMENT,
  3. `name` VARCHAR(45) NULL,
  4. PRIMARY KEY (`idteam`));
  5.  
  6. hibernate:
  7. cache:
  8. queries: false
  9. use_second_level_cache: true
  10. use_query_cache: false
  11. region.factory_class: org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory
  12.  
  13. dataSource:
  14. pooled: true
  15. jmxExport: true
  16. driverClassName: com.mysql.jdbc.Driver
  17. username: root
  18. password: 1111
  19.  
  20. environments:
  21. development:
  22. dataSource:
  23. dbCreate: create-drop
  24. url: jdbc:mysql://localhost:3306/ggloor?useSSL=false
  25. test:
  26. dataSource:
  27. dbCreate: create-drop
  28. url: jdbc:mysql://localhost:3306/ggloor?autoreconnect=true;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
  29. production:
  30. dataSource:
  31. dbCreate: create-drop
  32. url: jdbc:mysql://localhost:3306/ggloor?autoreconnect=true;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
  33. properties:
  34. jmxEnabled: true
  35. initialSize: 5
  36. maxActive: 50
  37. minIdle: 5
  38. maxIdle: 25
  39. maxWait: 10000
  40. maxAge: 600000
  41. timeBetweenEvictionRunsMillis: 5000
  42. minEvictableIdleTimeMillis: 60000
  43. validationQuery: SELECT 1
  44. validationQueryTimeout: 3
  45. validationInterval: 15000
  46. testOnBorrow: true
  47. testWhileIdle: true
  48. testOnReturn: false
  49. jdbcInterceptors: ConnectionState
  50. defaultTransactionIsolation: 2 # TRANSACTION_READ_COMMITTED
  51.  
  52. package testgrails12
  53.  
  54. import grails.persistence.Entity
  55.  
  56. @Entity
  57. class Teams {
  58. Integer idteam
  59. String name
  60. static constraints = {
  61. }
  62. }
  63.  
  64. package testgrails12
  65.  
  66. class BdconnectController {
  67.  
  68. def index() {
  69. def team = Teams.get(1)
  70. team.delete()
  71. team.save()
  72. render "hello"
  73. }
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement