Skip to content

Instantly share code, notes, and snippets.

View gkastrinis's full-sized avatar
🦄
Chasing Unicorns

George Kastrinis gkastrinis

🦄
Chasing Unicorns
View GitHub Profile
@bradkarels
bradkarels / embeddedH2.groovy
Created December 17, 2014 19:48
Simple example: Embed H2 database within a groovy script (file based persistence)
@GrabConfig(systemClassLoader=true)
@Grab(group='com.h2database', module='h2', version='1.3.176')
import java.sql.*
import groovy.sql.Sql
import org.h2.jdbcx.JdbcConnectionPool
println("More groovy...")
def sql = Sql.newInstance("jdbc:h2:things", "sa", "sa", "org.h2.Driver") // DB files for 'things' in current directory (./hello.h2.db)