Guest User

Untitled

a guest
Jan 13th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1.  
  2. // PostgreSQL
  3. @GrabConfig(systemClassLoader=true)
  4. @Grab('postgresql:postgresql:9.0-801.jdbc4')
  5. def sql = groovy.sql.Sql.newInstance(
  6. "jdbc:postgresql://host.example.org/database",
  7. "username", "password", "org.postgresql.Driver")
  8.  
  9. // MySQL
  10. @GrabConfig(systemClassLoader=true)
  11. @Grab('mysql:mysql-connector-java:5.1.12')
  12. def sql = groovy.sql.Sql.newInstance(
  13. "jdbc:mysql://host.example.org/database",
  14. "username", "password", "com.mysql.jdbc.Driver")
  15.  
  16. // MS SQL Server
  17. @GrabConfig(systemClassLoader=true)
  18. @Grab('net.sourceforge.jtds:jtds:1.2.2')
  19. def sql = groovy.sql.Sql.newInstance(
  20. "jdbc:jtds:sqlserver://host.example.org/database",
  21. "username", "password", "net.sourceforge.jtds.jdbc.Driver")
  22.  
  23. // HSQLDB embedded
  24. @GrabConfig(systemClassLoader=true)
  25. @Grab('org.hsqldb:hsqldb:2.0.0')
  26. def sql = groovy.sql.Sql.newInstance(
  27. "jdbc:hsqldb:mem:database", "sa", "", "org.hsqldb.jdbcDriver")
  28.  
  29. // H2 embedded
  30. @GrabConfig(systemClassLoader=true)
  31. @Grab('com.h2database:h2:1.3.148')
  32. def sql = groovy.sql.Sql.newInstance(
  33. "jdbc:h2:mem:database", "sa", "", "org.h2.Driver")
Add Comment
Please, Sign In to add comment