Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Edit your $GROOVY_HOME/conf/groovy-start.conf and add the following line:
- load !{user.home}/.groovy/grapes/**.jar
- After that your @Grab will work as advertised:
- #!/usr/bin/env groovy
- @Grab(group='mysql', module='mysql-connector-java', version='5.1.12')
- import groovy.sql.Sql
- def sql = Sql.newInstance("jdbc:mysql://hostname/database", "username", "password", "com.mysql.jdbc.Driver")
- sql.firstRow("select * from users where id=1")
Add Comment
Please, Sign In to add comment