Posted By

alces on 02/14/13


Tagged

properties hsqldb groovlet


Versions (?)

Load HSQLDB connection parameters from .properties file in groovlet


 / Published in: Groovy
 

URL: groovlet_hsqldb_properties

Example of using .properties file for get database connection parameters into script

  1. //hsqldb.properties must be in WEB_INF/classes dir for this style loading
  2. getClass().classLoader.getResource('hsqldb.properties').withReader {
  3. System.properties.load it
  4. }
  5. arg = 'dsn user pass drv'.split().collect {
  6. System.properties."hsqldb.$it"
  7. }
  8. db = Sql.newInstance(*arg)

Report this snippet  

You need to login to post a comment.